What is data-bound properties?

后端 未结 2 1418
[愿得一人]
[愿得一人] 2020-12-06 09:51

I am trying to understand OnInit functionality in angular2 and read the documentation:

Description

Implement this interface to execute cu

2条回答
  •  Happy的楠姐
    2020-12-06 10:19

    @Input is a decorator that makes a class field as an input property and supplies configuration metadata. The input property is bound to a DOM property in the template. During change detection, Angular automatically updates the data property with the DOM property's value.

    I hope this answer may help to understand this concept.

    Above example contains name as an input which is bound as property for component in DOM structure & angular updates it based on changes.

提交回复
热议问题