Loading ...

Angular 2 Property Binding

Hello everybody,

today I want to write few words about binding in AngularJS 2.

There are two ways of making one way binding:

  1. element property binded to template expression
  2. property interpolation

I've described it with following picture:

AngularJS property binding.png

Two-way Binding

<input [(ngModel)]='property'>

And property is decalred in Component class like this:

 

export class ClassComponent {

       property: string = "Property value";

}

Be the first to rate this post

  • Currently 0.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5