Wednesday, January 10, 2018

The template setting for [(ngModel)] doesn't necessarily have to have a dance partner on the TypeScript in a component.

Without it you are of course doing a two-way databinding to nothing. You may use the same setting in two controls and as you type in one control the other control will be updated too. I don't know that there is really any praxis for not having a counterpart at the component. I just found this interesting. I suppose one negative side effect that could come from a lack of an error being explicitly thrown is that you could more easily mess your real wire-ups.

No comments:

Post a Comment