Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2301 Lượt xem

Hi everyone!
I have my module and I would like to update a variable dynamically.

This is my XML Code:


<div>
<
t t-if="!identifyBoolean">Loading... </t>
<t t-if="identifyBoolean">Ready! </t>
<
t t-esc="userIdentify()" />
</div>



identifyBoolean is a boolean variable and its first value is false.

userIdentify() is a function that makes an XHTTP request to my server and returns a string.

So, identifyBoolean is true when the XHTTP request is success, but it always is false in template, in JS is true.

On the other hand, userIdentify() seems like it doesn't wait the return.


I don't know what I'm doing wrong. Can you help me, please?

What is the best way to do this?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 25
3719
0
thg 2 23
1922
4
thg 5 25
10755
3
thg 2 25
12427
1
thg 8 22
48