Skip to main content

Posts

Showing posts with the label Types of Bindings in Angular 2 and Example

Bindings in Angular 2 [Types of Bindings and Example]

Types of Bindings – Interpolation (evaluates expressions)- ·          < span > {{ 4+6 }} </ span > <!-- Result = 10 --> ·          < span > {{ user.name }} </ span > <!-- Result = Anil Singh --> Null Guard – ·          < span > {{ user?.name }} </ span > Input Binding – ·          < span [property] ="user"></ span > Output Binding – ·          < span [click] ="addUser(user)"></ span > Two Way Binding – ·          < span [(property)] ="user"></ span > Stayed Informed – Angular 2 documentations and examples The below example help us to learn the Annular 2 binding and where we use in real project. home.component.html :- ...