We have "Add Contact" component working. But we are in search of a better way to do form bindings. The way we did in our previous exercise does work, but it is tough to keep up with a growing form. We want a better way and there is
new-contact.component.ts
What we have achieved here is pretty simple two-way binding. You may want to also read on observer pattern in Angular2.
new-contact.component.ts
/** * Created by krishnansriramrama on 5/28/16. */ import {Component, OnInit} from 'angular2/core'; import {ContactsService} from "./ContactsService"; import {Contact} from "./Contact"; @Component({ selector: 'new-contact', template: `
What we have achieved here is pretty simple two-way binding. You may want to also read on observer pattern in Angular2.
No comments:
Post a Comment