I do not have a master's degree in Prototypal Inheritance, but I will try my best to explain this in the near future (there are many resources on this subject);
NumberStringBooleannullundefinedSymbol (with ES6)
primitives (MDNs) are considered.
Now — when you inherit a “primitive” from your parent area, what is actually happening is that the child area “mirrors” or “shadows” the given primitive value. So you can see this as a copy of the above.
This is roughly the nature of primitives in the context of prototype inheritance.
This can be clearly seen in the modified version of your broken violin .
Try playing with two inputs, and you will see that there is a connection of two values when you touch only the external input (that is, the child value of the "shadow" of the parent value). But as soon as you touch the internal input, the values are disconnected from each other.
the recommended way to get around this is to use a property reference on your model (I say the model, but it's really just a JS object), which is defined later in the prototype chain;
$parentScope.obj = { filterText: '' }; ng-model="obj.filterText"
Now it will be nice for you to go with ngIf , ngSwitch , ngRepeat , to name a few of the angular supplied directives that create a new scope.
Related Resources
Kasper Lewau
source share