If I have a parent-child component relationship in angular 2 like so:
@Component({
selector: `child`,
template: `
<div>
</div>`
})
export class ChildComponent {
//...
}
@Component({
selector: `parent`,
template: `
<div>
<child [(ngModel)]="data.value"></child>
</div>`
directives: [ChildComponent]
})
export class ParentComponent {
private data = {
value: string,
property: number
};
}
How would I access the ngModel in the child component? If I modified the ngModel value in the child component will it update the parent component?