【发布时间】:2019-03-14 08:34:32
【问题描述】:
我对 Angular 和 typescript 还很陌生,但我有一个使用 Ionic 3 元素的 Angular 6 项目。
我正在尝试将一个从路径 ../lib/ionic.bundle.js 的 cdn 本地保存的库导入到我的项目中,但我收到模板解析错误,这表明该模块未针对该路径导入。
Error: Template parse errors:
'ion-card-header' is not a known element:
1. If 'ion-card-header' is an Angular component, then verify that it is part of this module.
2. If 'ion-card-header' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-card>
import { IonicApp, IonicModule } from '../lib/ionic.bundle.js';
const routes: Routes = [
{
path: 'create',
component: CreateComponent
},
{
path: 'edit/:id',
component: EditComponent
},
{
path: 'index',
component: IndexComponent
}
];
@NgModule({
declarations: [
CreateComponent,
IndexComponent,
EditComponent,
],
imports: [
IonicModule.forRoot(routes)
],
providers: [ ...]
})
export class AppModule { }
我确定该文件存在于该路径中,但由于某种原因没有被导入。
是否有不同的方式来导入IonicModule?
【问题讨论】:
-
你能提供你的文件夹结构吗?
标签: javascript angular typescript ionic3