+ 2
2 way data binding [SOLVED]
Why is the text below the input not updated when the input value changes. https://code.sololearn.com/WNuKMwluM0F9/ Please look at line 35 and line 64
4 odpowiedzi
+ 2
I think I have figured this out myself. The way my `oneWayBind` function was set up, it can bind to only one element. I made some changes and now it works.
Also, I discovered `oneWayBind` is actually doing 2-way data binding 😂
+ 3
<input oninput="app.twoWay=this.value">
https://code.sololearn.com/WAvrrjGAuNcI/?ref=app
+ 1
Gordon This does not answer my question on WHY the text is not updated.
I actually know about HTML oninput attribute. But it is actually one way binding because if `app.twoWay` changes, the input value will not be updated. So your code is actually not different from the problem I am already facing.
+ 1
😂