Difference between [(ngModel)] and [ngModel] for binding state to property?

前端 未结 5 1078
时光说笑
时光说笑 2020-12-12 11:23

Here is a template example:



        
5条回答
  •  醉梦人生
    2020-12-12 11:51

    It's quite simple [] => component to template () => template to component [(ngModel)] is a contracted form of [ngModel]="currentHero.name" (ngModelChange)="currentHero.name=$event">

    More detail here : https://angular.io/docs/ts/latest/guide/template-syntax.html#!#ngModel

提交回复
热议问题