[IMP] add support for t-call-context directive

This commit is contained in:
Géry Debongnie
2022-06-22 14:39:42 +02:00
parent 5772b4e9e4
commit c7459ef87b
8 changed files with 279 additions and 11 deletions
+9
View File
@@ -540,6 +540,15 @@ This can be used to define variables scoped to a sub template:
<!-- "var" does not exist here -->
```
Note: by default, the rendering context for a sub template is simply the current
rendering context (so, the current component). However, it may be useful to be
able to specify a specific object as context. This can be done by using the
`t-call-context` directive:
```xml
<t t-call="other-template" t-call-context="obj"/>
```
### Dynamic sub templates
The `t-call` directive can also be used to dynamically call a sub template,