我想根據(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>
如何根據(jù)布爾值交換內(nèi)容?
慕妹3146593
2021-08-20 18:43:33