mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] compiler: add support for #{...} in string interpolation
This commit is contained in:
committed by
Sam Degueldre
parent
a3111eb9ca
commit
385e118e58
@@ -27,6 +27,15 @@ describe("t-ref", () => {
|
||||
expect(refs.myspan3.tagName).toBe("SPAN");
|
||||
});
|
||||
|
||||
test("can get a dynamic ref on a node, alternate syntax", () => {
|
||||
const template = `<div><span t-ref="myspan#{id}"/></div>`;
|
||||
const refs: any = {};
|
||||
const bdom = renderToBdom(template, { id: 3, __owl__: { refs } });
|
||||
expect(refs).toEqual({});
|
||||
mount(bdom, document.createElement("div"));
|
||||
expect(refs.myspan3.tagName).toBe("SPAN");
|
||||
});
|
||||
|
||||
test("refs in a loop", () => {
|
||||
const template = `<div>
|
||||
<t t-foreach="items" t-as="item" t-key="item">
|
||||
|
||||
Reference in New Issue
Block a user