[IMP] template set config: getTemplate function

A template set can now obtain a template by calling the function
getTemplate (if any) received in the initial config.
The returned value can be an Element instance, a template string, a
function (i.e. a compiled template), or null. In the last case, owl will
look into the template set rawTemplates object.
This commit is contained in:
Mathieu Duckerts-Antoine
2024-01-10 16:49:32 +01:00
committed by Sam Degueldre
parent 70101e4c66
commit 7b454dae66
4 changed files with 116 additions and 1 deletions
+2
View File
@@ -61,6 +61,8 @@ The `config` object is an object with some of the following keys:
templates (see [translations](translations.md))
- **`templates (string | xml document)`**: all the templates that will be used by
the components created by the application.
- **`getTemplate ((s: string) => Element | Function | string | void)`**: a function that will be called by owl when it
needs a template. If undefined is returned, owl looks into the app templates.
- **`warnIfNoStaticProps (boolean, default=false)`**: if true, Owl will log a warning
whenever it encounters a component that does not provide a [static props description](props.md#props-validation).