diff --git a/owl.js b/owl.js index aec8ad59..f8cb1c64 100644 --- a/owl.js +++ b/owl.js @@ -1297,6 +1297,13 @@ } return; } + const firstLetter = node.tagName[0]; + if (firstLetter === firstLetter.toUpperCase()) { + // this is a component, we modify in place the xml document to change + // to + node.setAttribute('t-widget', node.tagName); + node.nodeValue = 't'; + } const attributes = node.attributes; const validDirectives = []; let withHandlers = false; @@ -2711,7 +2718,7 @@ * explanation of the code generated by the t-widget directive for the following * situation: * ```xml - * @@ -3490,8 +3497,8 @@ exports.utils = utils; exports.__info__.version = '0.15.0'; - exports.__info__.date = '2019-06-17T13:59:39.059Z'; - exports.__info__.hash = '609c108'; + exports.__info__.date = '2019-06-18T13:03:02.358Z'; + exports.__info__.hash = 'a7cd007'; exports.__info__.url = 'https://github.com/odoo/owl'; }(this.owl = this.owl || {})); diff --git a/playground/samples.js b/playground/samples.js index 52f7cc71..c2bd1858 100644 --- a/playground/samples.js +++ b/playground/samples.js @@ -26,8 +26,8 @@ const COMPONENTS_XML = `
- - + +
`; @@ -88,7 +88,7 @@ const ANIMATION_XML = `
- +
@@ -98,7 +98,7 @@ const ANIMATION_XML = `
- +
@@ -236,7 +236,7 @@ const LIFECYCLE_DEMO_XML = `
- +
`; @@ -483,7 +483,7 @@ const TODO_APP_STORE_XML = `
    - +
@@ -995,17 +995,17 @@ const RESPONSIVE_XML = `
- - + +
- - + +
- - + +
@@ -1128,17 +1128,17 @@ const SLOTS_XML = `
- + Content of card 1... [] - - + +
Card 2... []
- +
-
+
`; @@ -1226,8 +1226,8 @@ app.mount(document.body); const ASYNC_COMPONENTS_XML = `
- - + +
diff --git a/playground/templates.xml b/playground/templates.xml index 9a4d82a7..1c67cc6d 100644 --- a/playground/templates.xml +++ b/playground/templates.xml @@ -24,14 +24,14 @@
-
-