[IMP] owl: add a new mount method

This commit is contained in:
Géry Debongnie
2020-10-27 14:41:09 +01:00
committed by aab-odoo
parent d615ffd81b
commit cb07c99d40
17 changed files with 191 additions and 126 deletions
+4 -6
View File
@@ -49,15 +49,14 @@ The correct way to customize an environment is to simply set it up on the root
component class, before the first component is created:
```js
App.env = {
const env = {
_t: myTranslateFunction,
user: {...},
services: {
...
},
};
const app = new App();
app.mount(document.body);
mount(App, { target: document.body, env });
```
It is also possible to simply share an environment between all root components,
@@ -121,9 +120,8 @@ async function myEnv() {
}
async function start() {
App.env = await myEnv();
const app = new App();
await app.mount(document.body);
const env = await myEnv();
mount(App, { target: document.body, env });
}
```