@danbucholtz_brady wrote:
Hello,
I have a series of components that talk to eachother through @input and @output events/subscribers. Basically, a child component publishes an event via the @output EventEmitter, and the parent then passes the result back down to a different child via the input directive in the html.
For the sake of discussion, let's say I have this decorated variable in a component:
@input var myVar= "tacos"
I am looking for a way to detect when a variable's value changes in my javascript component code. There is the ngOnChanges function, and I suppose I could inspect the SimpleChange object for a reference to "myVar". Is there a better, more scalable way to do it, similar to $scope.$watch functionality from ng1? I cannot figure this out from extensive googling.
I am a bit of an observable n00b so I am hoping that's the secret sauce I need.
Thanks,
Dan
Posts: 1
Participants: 1