The situation is:
I have an angular form:
<form #f="ngForm" (ngSubmit) = search(f) novalidate >
<input name="inputCustomerId" [(ngModel)]="customerId" type= "number">
<a type="button" (click)="search(f)">Search</a>
</form>
<app-graph *ngIF="customerId" [nodeName]="customerId"></app-graph>
And in the .ts file:
export class C implements OnInit{
customerId: any;
constructor(){}
ngOnInit(){}
}
search(form:ngForm){
if(form.valid){
this.customerId = form.value.inputCustomerId;
}
}
The Problem is when clicking the button the app-graph component doesn't detect the input change.
How can I make it reload or update data?