【发布时间】:2020-09-05 21:48:57
【问题描述】:
我正在尝试在我的 ionic 应用程序中使用“ion-progress-bar”。但它抛出了以下错误。
我尝试寻找解决方案,但不知何故无法解决。请提出错误在哪里。
我的 home.html 如下所示:
<ion-content>
<ion-progress-bar></ion-progress-bar>
</ion-content>
在我的 app.module.ts 中,我有以下内容:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
错误如下:
Error: Template parse errors:
'ion-progress-bar' is not a known element:
1. If 'ion-progress-bar' is an Angular component, then verify that it is part of this module.
2. If 'ion-progress-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<!-- <ion-progress-bar value="0.5"></ion-progress-bar> -->
[ERROR ->]<ion-progress-bar></ion-progress-bar>
【问题讨论】:
-
验证 IonProgressBar 是否在 IonicModule 中导出,并确保 IonicModule 在您的导入数组中。另外,你的 home 组件在你的 app.module 中吗?
标签: html angular ionic-framework ionic4