With the introduction of the component concept, Angular 1.5 also introduced one-way data binding (<). However, the manual says:
Please note, however, that both the fields of the parent and the component refer to the same object, so if you change the properties of the object or the array elements in the component, the parent will still reflect this change. Therefore, the general rule should be to never change the property of an object or array in the component area.
Indeed, changing the property of an object in the directive / component area is reflected in the parent area - not like unidirectional binding, it just adds confusion to all this - now we have unidirectional binding, which is better not to use for objects or arrays, whereas for strings we have @.
What could be a useful scenario for using one-way data binding in the real case? Or is it a good idea to completely avoid this, in order to protect yourself from unexpected changes - since a unidirectional concept screams that it is unidirectional, but it is not?
source share