Angular2 two-way data binding

前端 未结 8 1838
谎友^
谎友^ 2020-12-15 05:10

I know Angular2 doesn\'t have two-way data binding but is there a way to mimick the two-way data binding behavior from Angular1.x?

8条回答
  •  长情又很酷
    2020-12-15 05:33

    You can now simply do this by using ngModel using the following syntax:

    
    

    The combination of the square and round brackets means "two-way binding".

    Please see the plunk here

提交回复
热议问题