Just to clarify, keep in mind that the location of the brackets is important!
They can be added to any HTML tags ... span, div, table, p, tr, td, etc.
Angularjs
ng-if="check1 && !check2" -- AND NOT ng-if="check1 || check2" -- OR ng-if="(check1 || check2) && check3" -- AND/OR - Make sure to use brackets
Angular2 +
*ngIf="check1 && !check2" -- AND NOT *ngIf="check1 || check2" -- OR *ngIf="(check1 || check2) && check3" -- AND/OR - Make sure to use brackets
It is recommended that you do not perform the calculations directly in ngIfs, so assign the variables inside your component and execute any logic there.
boolean check1 = Your conditional check here... ...
Chris May 31 '19 at 11:49 2019-05-31 11:49
source share