[IMP] qweb: add renderToString method

closes #230
This commit is contained in:
Géry Debongnie
2019-07-09 09:45:43 +02:00
committed by aab-odoo
parent 9f1e64d399
commit e24ff8f8aa
3 changed files with 39 additions and 2 deletions
+7
View File
@@ -122,6 +122,13 @@ It's API is quite simple:
const vnode = qweb.render("App", component);
```
- **`renderToString(name, context)`**: renders a template, but returns an html
string.
```js
const str = qweb.renderToString("someTemplate", somecontext);
```
- **`register(name, Component)`**: static function to register an OWL Component
to QWeb's global registry. Globally registered Components can be used in
templates (see the `t-component` directive). This is useful for commonly used