Using @Input() implies that you rely on the Angular2 mechanism to propagate value changes, which means that you should not expect your changes to take effect immediately. In fact, your this.parentParam = 9; An entire Angular2 loop will go through to update your child param , and the showParam() function will always be executed first.
To achieve your task you have 2 options:
1) Add the parameter directly to your showParam , as in:
// child component public showParam(newVal: number) { this._param = newVal; // do your service call here } // parent component public updateChildValue() { this.parentParam = 9; this.child.showParam(9); }
2) Leverage ngOnChanges on your Child component. This function will be called by Angular2 every time any @Input . However, if you have more than 1 input, this can be problematic.
ngOnChanges(changes) { console.log(this.param); // new value updated }
source share