How does [(ngModel)] works with Unidirectional data flow in Angular 2
问题 Angular 2 supports unidirectional data flow, one way at a time. How does two way data binding [(ngModel)] works in Angular2 ? 回答1: Angular2 comprehends [(ngModel)] = myName as a property + event binding and as a collapsed version of, [ngModel] = 'myName' , and (ngModelChange) = 'updateMyNameValue(myName)' Their unidirectional data flow policy might as well as take the expanded version of it such as setting the scope variable explicitly by the inputs event when the value is changed and vice