2016-06-28 7 views
0

"threeMonth and complimentary"モデルをオブジェクトとして呼び出すことで、可視かどうかを調べ、表示されていない場合は最後のタグを表示することができます。基本的に私はしたい場合は/ ELSEIF/ELSE何とかngModelがngIfによって表示されるかどうかを確認するにはどうすればよいですか?

<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> 

答えて

1

醜いソリューション - 以前の2を組み合わせると持たざる者と文:

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

より良いソリューション - ケースを生成して、デフォルトを設定するためにngSwitchを使用して、あなたの最後のオプション。

関連する問題