İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
3729 Görünümler

I have the following template:

<t t-name='test_template'>
     <t t-call="other_template"/>
</t>

And I have the following code:

alert(data['items'].length);
var html = $(this.qweb.render("test_template", {'data' : data}));
alert(data['items'].length);


The first alert is showing 30. The second one is showing 1.

Why is the template renderer changing the object reference passed as data?

This only happens when using sub-template calling.

Avatar
Vazgeç
Üretici En İyi Yanıt

It was my own fault. The problem was in another template.

I had somethine like this:

<t t-if="items.length > 1">

And I the correct code is:

<t t-if="items.length &gt; 1">

">" is a special character in xml.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Mar 15
3860
0
Nis 25
1492
0
Oca 24
1693
2
Şub 24
15350
4
Nis 24
20572