I am trying to iterate array using *ngFor inside the template and searching for an element based on the key, using *ngIf. Now when the condition is matched with
*ngFor
There is no option to break ngFor. You can use a custom pipe that doesn't return values after the element where the condition is met.
ngFor
For more concrete approaches please provide more concrete information about what you actually try to accomplish.