better error message when owl cannot find a template
This component:
class MyComponent extends Component {
template = xml`<div>hello</div>`;
}
will fail with the message: Could not find template for component "Parent"
But in this case, it can infer that there is actually a (non static) template property. So, it would be more developer-friendly if in this specific case, it would give the following error message:
Could not find template for component "Parent". However, there is a (instance, not a class) 'template' property. Maybe this should simply be defined as a class (or static) property?
How can i load a template from an XML file.
For example i have this:
Hello\
hello.html
hello.js
hello.xml
owl.min.js
Here are my codes:
hello.html
<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
<script type="text/javascript" src="owl.min.js"></script>
<script type="module" src="hello.js"></script>
</head>
<body>
</body>
</html>
hello.js
const { Component } = owl;
const { xml } = owl.tags;
class App extends Component {
static template = TemplateTags;
}
const app = new App();
app.mount(document.body);
hello.xml
<div>Hello Owl</div>
How can i load TemplateTags from my hello.xml file?
I looked into Jabberwock repo but i can't understood, please help!