Disabling two-way data binding

In case we don’t like having a two-way binding relationship, we can easily turn it off by removing the parentheses around the ngModel directive within the quiz.component.html file, leaving only the square brackets:

<input [ngModel]="test.Title" placeholder="Insert the title..."/>

The parentheses within brackets that enable two-way binding [()] are widely known as banana brackets. This funny name has its roots in the Adventure in Angular podcast episode 078, featuring Brad Green, Misko Hevery, and Igor Minar, in which they referred to that syntax by calling it a “box of bananas”. Other than being an impressive visualization, the banana-box concept helps us to avoid common mistakes such as placing the brackets inside the parentheses.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.187.113