I am using a child component that has an input property.
<child [inputprop]="input"></child>
The child component doesn't implement ngOnChanges. I would like to update the component from parent. What's the best way to do this?
I have looked at using ngIf
and re-rendering the component. Is there a cleaner way?
<child [inputprop]="input" ngIf="render"></child>
component
rerender() {
render=false
cdRef.detectChanges()
render=true
}
Edit: I can't change the code of the child component. I am looking for better ways to do this without changing the child component.