Is there a way to ensure that the value of submitted
in the child component always matches the value of submitted
in the parent component? Appreciate any help!
@Component({
selector: 'child-cmp',
template: `
child:{{submitted}}
`
})
class ChildCmp {
@Input('submitted') submitted: boolean;
ngOnInit() {
this.submitted = true;
}
}
@Component({
selector: 'app',
template: `
<child-cmp [submitted]="submitted"></child-cmp>
parent:{{submitted}}
`,
directives: [ChildCmp]
})
class App {
submitted: boolean;
}
bootstrap(App);