第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何根據(jù)布爾值交換內(nèi)容?

如何根據(jù)布爾值交換內(nèi)容?

慕妹3146593 2021-08-20 18:43:33
我想根據(jù)布爾值是真還是假來交換我的 page.html 中的一些內(nèi)容。所以我看到你可以用 來創(chuàng)造這樣的東西,<ng-content>但不知何故這并沒有奏效。我收到此錯誤:Error: Template parse errors: <ng-content> element cannot have content.我還注意到必須有某種方法可以刪除舊內(nèi)容。頁面.html      <ion-card>    <!--  content to move away when bool true-->        </ion-card>    <div *ngIf="!checked">    <ng-content>      <ion-card><!-- new content when bool false--></ion-card>    </ng-content>       </div>       
查看完整描述

1 回答

?
互換的青春

TA貢獻1797條經(jīng)驗 獲得超6個贊

有兩個單獨的條件對你有用嗎?


<ion-card *ngIf="checked">

    <!--  content to move away when bool true-->

</ion-card>


<ion-card *ngIf="!checked">

    <!-- new content when bool false-->

</ion-card>

如果這不起作用,您可以使用開關(guān)


<div [ngSwitch]="checked">

    <ion-card *ngSwitchCase="true">

        <!--  content to move away when bool true-->

    </ion-card>

    <ion-card *ngSwitchCase="false">

        <!-- new content when bool false-->

    </ion-card>

</div>


查看完整回答
反對 回復 2021-08-20
  • 1 回答
  • 0 關(guān)注
  • 180 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號