通过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 { }