【发布时间】:2021-05-13 08:22:41
【问题描述】:
由于某种原因,我正在使用 Ionic 6.12.4 构建应用程序,但我不断收到此错误代码。我正在放置错误的屏幕截图和我的代码示例。如果有什么我可以不做或添加的,请告诉我。
app.component.ts
import { Component, OnInit } from '@angular/core';
import { Platform } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html'
})
export class AppComponent {
public appPages = [
{
title: 'home',
url: '/home',
icon: 'home'
},
{
title: 'List',
url: '/list',
icon: 'list'
}
];
constructor(
public platform: Platform,
private splashScreen: SplashScreen,
private statusBar: StatusBar
) {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
}
【问题讨论】:
-
检查您的
app.module.ts,您可能已经在没有 ngx 的情况下导入了它们。
标签: angular ionic-framework cordova-plugins