简体   繁体   English

'ion-progress-bar' 是一个 Angular 组件,然后验证它是这个模块的一部分

[英]'ion-progress-bar' is an Angular component, then verify that it is part of this module

I am trying to use 'ion-progress-bar' in my ionic app.我正在尝试在我的离子应用程序中使用“离子进度条”。 But it is throwing the below error.但它抛出以下错误。

I tried finding solution but somehow not able to resolve.我试图找到解决方案,但不知何故无法解决。 Please suggest where is am doing the mistake.请建议我在哪里做错了。

My home.html looks like below:我的 home.html 如下所示:

<ion-content>
<ion-progress-bar></ion-progress-bar>  
</ion-content>

In my app.module.ts, i have the below:在我的 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';

The error is as below:错误如下:

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>  

check weather you registered this component IonProgressBar in the app.module.ts like检查天气你在 app.module.ts 中注册了这个组件 IonProgressBar 像

declarations: [
    MyApp ,
    IonProgressBar 
  ]

Also in the IonProgressBar .ts file check同样在 IonProgressBar .ts 文件中检查

@Component({
  selector: 'ion-progress-bar',
  ----------------------------
  ----------------------------
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM