跳至內容
選單
此問題已被標幟
2535 瀏覽次數

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?

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
3月 25
4069
0
2月 23
2213
4
5月 25
11970
3
2月 25
14052
1
8月 22
48