mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] small cleanup for template helpers
This commit is contained in:
committed by
Samuel Degueldre
parent
2a1b99be2d
commit
79738e00c7
@@ -71,3 +71,17 @@ export class Markup extends String {}
|
||||
export function markup(value: any) {
|
||||
return new Markup(value);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// xml tag helper
|
||||
// -----------------------------------------------------------------------------
|
||||
export const globalTemplates: { [key: string]: string | Element } = {};
|
||||
|
||||
export function xml(...args: Parameters<typeof String.raw>) {
|
||||
const name = `__template__${xml.nextId++}`;
|
||||
const value = String.raw(...args);
|
||||
globalTemplates[name] = value;
|
||||
return name;
|
||||
}
|
||||
|
||||
xml.nextId = 1;
|
||||
|
||||
Reference in New Issue
Block a user