How is this possible? Just change values on the object being handed down. The wrapping component and the nested component are going to be using the same reference. You may then have logic in your wrapping component check against state changes in the object being handed in as an Input to the nested component. This provides a way to speak back up without an EventEmitter. Is it the most elegant thing to do? Maybe not. This will not trigger ngOnChanges at the wrapper so if you need an immediate reaction you will still need to use an EventEmitter. If you merely need to react when a user clicks something or something like that however, this will work for you. You may doublecheck state at that time.
No comments:
Post a Comment