Skip to main content

TemplateServiceParameters

@webda/templates


Class: TemplateServiceParameters

Defined in: packages/templates/src/template.service.ts:13

Parameters of the TemplateService

Extends​

  • ServiceParameters

Constructors​

Constructor​

new TemplateServiceParameters(): TemplateServiceParameters

Returns​

TemplateServiceParameters

Inherited from​

ServiceParameters.constructor

Properties​

cache?​

optional cache?: boolean

Defined in: packages/templates/src/template.service.ts:32

Cache compiled templates, always disabled in debug mode

Default​

true

engine?​

optional engine?: string

Defined in: packages/templates/src/template.service.ts:23

Engine winning when several handle the same extension

Default​

"mustache"

engines?​

optional engines?: Record<string, any>

Defined in: packages/templates/src/template.service.ts:27

Engine options, keyed by engine name, passed to the engine configure


folders?​

optional folders?: string[]

Defined in: packages/templates/src/template.service.ts:18

Folders to look templates into, in priority order

Default​

["./templates"]

type​

type: string

Defined in: packages/core/lib/services/serviceparameters.d.ts:9

Type of the service

Inherited from​

ServiceParameters.type

Methods​

load()​

load(params?): this

Defined in: packages/templates/src/template.service.ts:39

Apply the defaults

Parameters​

params?​

any = {}

raw parameters

Returns​

this

this

Overrides​

ServiceParameters.load


update()​

update(params, delta): this

Defined in: packages/core/lib/application/parameters.d.ts:21

Update parameters and call watchers if a parameter was changed

Parameters​

params​

any

the service parameters

delta​

any

the delta

Returns​

this

this for chaining

Inherited from​

ServiceParameters.update


with()​

with(callback): this

Defined in: packages/core/lib/application/parameters.d.ts:27

Watch for changes on the parameters and call watchers when a parameter is changed

Parameters​

callback​

(params) => void

the callback function

Returns​

this

this for chaining

Inherited from​

ServiceParameters.with