问题描述:在Ionic v4项目中,Angular解析器无法解析Ionic v4标签模板。
解决方法:
import { IonicModule } from '@ionic/angular';
import { NgModule } from '@angular/core';
@NgModule({
imports: [
IonicModule.forRoot()
]
})
export class YourModuleName { }
import { Component } from '@angular/core';
import { IonContent } from '@ionic/angular';
@Component({
selector: 'your-component',
templateUrl: 'your-component.html',
styleUrls: ['your-component.scss'],
providers: [IonContent] // 引入Ionic v4的模块
})
export class YourComponent { }
Ionic v4 App
Item 1
Item 2
ionic build
ionic serve --clear-cache
如果问题仍然存在,请提供更多详细的错误信息和代码示例,以便我们能更好地帮助您解决问题。
上一篇:Angular解析器问题