Say we have component A as the parent component and component B as the child component. The child has an entrance what_is_xthat is provided by the parent. Something like that:
For parent:
@Component({
selector: 'cmp-A',
directives: [ComponentB],
template: `<cmp-B [what-is-x]="x"></cmp-B>`
})
export ComponentA {
public x: any = [1, 2, 3];
constructor() {
setTimeout(() => this.x.push(10), 2000);
}
}
For a child:
@Component({
selector: 'cmp-B',
template: `{{what_is_x}}`
})
export ComponentB {
@Input('what-is-x') public what_is_x: any;
}
My question is: if the parent has changed in xany way, is the child updated with the new value? According to the chapter "Communication" in the developer's manual (not yet released); must! but it has not been updated for me, I tried all the Betas so far (0,1,2)
source
share