One of the milestones in learning JS and Angular is to learn that two-way data binding to primitives is complex. If you want to make sure that data binding works, you should always pack it into an object - that’s what some elderly people in my company told me. My question is: why is this happening? What exactly is happening, what makes data binding with the primitives that are so linked in JS?
I found out that Javascript passes objects by respect and primitives by value. So, what exactly happens, for example, in AnguleJS Controller, which allows us to bind a primitive in ngModel?
EDIT
Any articles, pointers are more than welcome!
source
share