找不到模块“@angular/核心/src/元数据/指令”



我在尝试查看我的 Ionic2 应用程序时收到此错误。我尝试在我的应用程序中实现天气应用程序。我不确定这是否会导致错误。

我不确定错误来自哪里,所以我不确定要发布哪个代码,所以,如果您需要查看代码的某个部分,请告诉我。

找不到模块"@angular/核心/src/元数据/指令">

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();
    });
  }
}

Deep imports不支持我在上面的评论中提到的,更改

import {Input} from '@angular/core/src/metadata/directives';

 import {Input} from '@angular/core';

将导入更改为:

import {Input} from '@angular/core';

并重新启动应用程序。

相关内容

  • 没有找到相关文章

最新更新