[Solved] Angular2/4: What do [] and () means in angular html files?


You need learn the basics of Angular 2 in order to understand these concepts.

  1. The [items]="items" is data binding in Angular 2 to pass data from parent component to virtual-scroll component where "items" is the property in parent component and [items] is the property of child component viz. virtual-scroll.

  2. The = passes the data from parent component to child component.

  3. (update)="viewPortItems = $event" is an event handler to the update event from virtual-scroll component. "viewPortItems = $event" assigns the event object to the viewPortItems property in parent component.

I hope this helps 🙂

0

solved Angular2/4: What do [] and () means in angular html files?