小编Elo*_*vid的帖子

*ng-如果在 ionic 5 中的 ion-modal 内不起作用

我正在使用 ionic 5 构建一个移动应用程序,当我尝试调用其中包含一个 ion-modal*ng-If时,我会收到此错误

Can't bind to 'ngIf' since it isn't a known property of 'ion-header'.
Run Code Online (Sandbox Code Playgroud)

模态是comment.page.ts中的评论部分,这里是comment.page.html的代码

<ion-header class="ion-no-border" *ngIf="!isLoading">
    <ion-toolbar>
        <ion-title class="centerAM">{{no_comm | shortNumber}} comment{{no_comm>1?'s':''}}</ion-title>
    </ion-toolbar>
</ion-header>

<ion-content>
....
Run Code Online (Sandbox Code Playgroud)

这是 comment.module.ts 的代码

import { NgModule } from '@angular/core';
import { IonicModule } from '@ionic/angular'; 
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { NgxEmojModule } from 'ngx-emoj';

import { CommentPageRoutingModule } from './comment-routing.module';
import { CommentPage } from './comment.page';
import { …
Run Code Online (Sandbox Code Playgroud)

javascript ionic-framework angular

3
推荐指数
2
解决办法
1143
查看次数

标签 统计

angular ×1

ionic-framework ×1

javascript ×1