mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[DOC] doc: use loadJS in code example
This commit is contained in:
+2
-3
@@ -220,9 +220,8 @@ in some cases, for example, to load external assets (such as a JS library)
|
|||||||
before the widget is rendered. Another use case is to load data from a server.
|
before the widget is rendered. Another use case is to load data from a server.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
willStart() {
|
async willStart() {
|
||||||
// we assume that utils.lazyLoad return a promise
|
await owl.utils.loadJS("my-awesome-lib.js");
|
||||||
return utils.lazyLoad('my-awesome-lib.js');
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user