【发布时间】:2018-06-30 08:24:38
【问题描述】:
我在尝试查看 Ionic2 应用程序时遇到此错误。我试图在我的应用程序中实现一个天气应用程序。我不确定这是否会导致错误。
我不确定错误来自哪里,所以我不确定要发布哪个代码,所以,如果您需要查看代码的某个部分,请告诉我。
找不到模块“@angular/core/src/metadata/directives”
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import firebase from 'firebase';
import { firebaseConfig } from './credentials';
import { HomePage } from '../pages/home/home';
import { Unsubscribe } from '@firebase/util';
import {MenuPage} from '../pages/menu/menu';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage: any;
constructor(
platform: Platform,
statusBar: StatusBar,
splashScreen: SplashScreen
) {
firebase.initializeApp(firebaseConfig);
const unsubscribe: Unsubscribe = firebase.auth().onAuthStateChanged(user => {
if (user) {
this.rootPage = HomePage;
unsubscribe();
} else {
this.rootPage = 'LoginPage';
unsubscribe();
}
});
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
});
}
}
【问题讨论】:
-
在问题中发布您的代码
-
正如我所提到的,我不知道错误来自哪里,所以我不确定要发布代码的哪一部分,抱歉
-
@ukbount 发布您的 component.ts
-
hmm 有没有你在代码中使用@angular/core/src/metadata/directives 的地方?
-
这个问题我也加了
标签: angularjs angular ionic-framework ionic2