Say we have component A as the parent component and component B as the child component. The child has an input what_is_x
that is supplied by the parent. Something like this:
For the 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 the child:
// component B with input what_is_x
@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 changed x
by some means, does the child get updated with the new value? According to the "Component communication" chapter in the developer guide (not released yet); it should! but it's not updated for me, tried all betas up till now (0,1,2)