I have an ngOnChanges that used SimpleChanges
ngOnChanges(changes: SimpleChanges): void {
for (const propName in changes) {
if (changes.hasOwnProperty(propName)) {
console.log(propName);
switch (propName) {
case 'generatedFunctionString':
this.setTooltipString();
}
}
}
}
But in the html I would like to make use of that function like this
<textarea title="Function String"
[(ngModel)]="generatedFunctionString"
[placeholder]="FUNCTION_DISPLAY_PLACEHOLDER"
(keyup)="ngOnChanges()">
</textarea>
Is there anyway I could pass the parameters to that method? Thank you.
You can pass parameter to ngOnChanges method as an object.