0

I want to be able to call this "threeMonth and complimentary" model as an object to find out if they are visible or not and display the last tag if they are not visible. Basically I want an if/elseif/else somehow

 <p  [(ngModel)]="threeMonth" name="threeMonth" *ngIf="(offers.offerAnnualIssues - offers.nssIssues) > offers.nssIssues">*3 MONTHS OF ISSUES</p>
<p [(ngModel)]="complimentary" name="complimentary" *ngIf="offers.custPrice != '2'">COMPLIMENTARY</p>
                  <p *ngIf="**If the threeMonth model is not visible and complimentary is not vivible show this**">*A FULL YEAR OF ISSUES</p>
David Makogon
  • 69,407
  • 21
  • 141
  • 189

1 Answers1

1

Ugly solution - combine the previous two if statements with nots:

*ngIf="!((offers.offerAnnualIssues - offers.nssIssues) > offers.nssIssues) && !(offers.custPrice != '2')"

Better solution - use ngSwitch to produce cases and set the default as your last option.

Jarod Moser
  • 7,022
  • 2
  • 24
  • 52