mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: allow t-call on arbitrary html nodes
This is a rarely (if ever) used feature, but according to our qweb reference implementation, it is possible to use the t-call directive on an arbitrary html tag, like this: <div t-call="my.template"/> It is then interpreted as: <div><t t-call="my.template"/></div> So, with this commit, we make sure that the owl qweb implementation matches that behaviour. closes #706
This commit is contained in:
@@ -1732,6 +1732,24 @@ exports[`t-call (template calling scoped parameters 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-call (template calling t-call allowed on a non t node 1`] = `
|
||||
"function anonymous(context, extra
|
||||
) {
|
||||
// Template name: \\"caller\\"
|
||||
let utils = this.constructor.utils;
|
||||
let scope = Object.create(context);
|
||||
let h = this.h;
|
||||
let c1 = [], p1 = {key:1};
|
||||
let vn1 = h('div', p1, c1);
|
||||
let _origScope3 = scope;
|
||||
scope = Object.create(scope);
|
||||
scope.__access_mode__ = 'ro';
|
||||
this.constructor.subTemplates['1'].call(this, scope, Object.assign({}, extra, {parentNode: c1, parent: utils.getComponent(context), key: '__4__'}));
|
||||
scope = _origScope3;
|
||||
return vn1;
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-call (template calling t-call with t-if 1`] = `
|
||||
"function anonymous(context, extra
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user