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 the key I want to break the *ngFor
. I wondered if there any option in angular2 to break the ngFor
loop based on condition.
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.
For more concrete approaches please provide more concrete information about what you actually try to accomplish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With