+ 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

30th Sep 2020, 6:38 PM
Ore
Ore - avatar
4 Answers
+ 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 😂
30th Sep 2020, 10:49 PM
Ore
Ore - avatar
+ 3
<input oninput="app.twoWay=this.value"> https://code.sololearn.com/WAvrrjGAuNcI/?ref=app
30th Sep 2020, 8:23 PM
Gordon
Gordon - avatar
+ 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.
30th Sep 2020, 10:31 PM
Ore
Ore - avatar
+ 1
😂
1st Oct 2020, 5:16 AM
Gordon
Gordon - avatar