I have been provided with a component which is simply a +/- counter. I can get a reference to the value I need from this component like this:
<sas-plus-minus value="0" min="0" max="99" #adultCount></sas-plus-minus>
{{ adultCount.val }}
adultCount.val
displays the correct value from the sas-plus-mins
component, but I don't know how to watch for changes in this value within the parent component. It would be quite difficult for me to modify this child component's code, in which I would probably use an Output()
to notify the parent of the change.
How can I register a wathcer in my parent component for this sas-plus-minus
's val
?
@Output
or aSubject
, but you will have to rely on events. – user4676340