其他分享
首页 > 其他分享> > ionic3 新建组件 提示 ion-xxx is not a known element

ionic3 新建组件 提示 ion-xxx is not a known element

作者:互联网

通过ionic g componennt xxx 创建一个组件,然后在组件中的html中写的ion-xxx标签 会提示未知元素,

解决方法:

在components.module.ts中引入

import { NgModule } from '@angular/core';
import { NavbarComponent } from './navbar/navbar';
import { IonicModule } from 'ionic-angular';

@NgModule({
    declarations: [NavbarComponent],
    imports: [
        IonicModule
    ],
    exports: [NavbarComponent]
})
export class ComponentsModule { }

 

标签:xxx,NavbarComponent,ionic3,ion,组件,import,angular
来源: https://www.cnblogs.com/johnjackson/p/13099369.html