Using <?
makes it possible for the controller to change the value of the variable that was supposed to be bound, only if that variable is not present.
The optional bindings can be modified in the controller when they are NOT present. If the value is passed to the component, then there's no way of changing it.
The non-optional bindings can not be modified whatsoever. If they are not present, they are undefined
and they can not be modified at all.
for example, assume you have this:
bindings: {
nameOptional: '<?',
nameRequired: '<'
}
In the controller, you can not simply do $ctrl.nameRequired = 'something else'
and expect the view to get updated. However, you can do the same with nameOptional
with one condition: only if name-optional
is not passed to the component. Only then the variable is the controller's to change.
For better understanding you can refer this fiddle.
Note that to simplify the thing, we're using a string which is passed by value. If you are passing objects, the object's properties can always get modified in normal conditions.