Reputation: 2275
I have an input with a numerical value, then that value is multiplied by 2 and the result is displayed. For example 1000 x 2 = 2000. How do I show a div as long as the result is less than 122?
<input type="number" [(ngModel)]="valueInitial">
<div>Result: {{ valueInitial * 2 }}</div>
Upvotes: 1
Views: 2956
Reputation: 222582
As you say in the question you should use *ngIf
<div *ngIf="valueInitial * 2 < 122">Result: {{ valueInitial * 2 }}</div>
Upvotes: 1