[IMP] app: add templates in app config

Also, improve the parsing code
This commit is contained in:
Géry Debongnie
2021-11-22 10:34:14 +01:00
committed by Lucas Perais - lpe@odoo
parent 536d9e1762
commit 4a4b1fbba5
3 changed files with 45 additions and 7 deletions
+4
View File
@@ -15,6 +15,7 @@ export interface AppConfig {
env?: Env;
translatableAttributes?: string[];
translateFn?: (s: string) => string;
templates?: string | Document;
}
export const DEV_MSG = `Owl is running in 'dev' mode.
@@ -49,6 +50,9 @@ export class App<T extends typeof Component = any> extends TemplateSet {
if (config.translatableAttributes) {
this.translatableAttributes = config.translatableAttributes;
}
if (config.templates) {
this.addTemplates(config.templates);
}
return this;
}