Validate expression in Angular 1.5 with operators

32 Views Asked by At

I have this expression in Angular 1.5 :

{{(var1/var2)*100}}

It show me a result but how can I validate inline if the value of var2 is 0, the result of the operation would be 0 inmediately??

Thanks

1

There are 1 best solutions below

0
Buh Buh On BEST ANSWER
{{ var2 ? ((var1/var2)*100) : 42.5 }}