运行时错误,错误:0:0导致:无法读取属性' initializeApp'未定义的

时间:2017-03-22 17:17:33

标签: angularjs firebase ionic-framework ionic2

我在构建应用程序时收到此错误消息。请帮我解决这个问题。

enter image description here

这是我的app.component.ts文件

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 { HomePage } from '../pages/home/home';
import { firebase } from 'firebase';


@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage = HomePage;

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {

     firebase.initializeApp({
       apiKey: "AIzaSyClMdXK3nVurFhGepjfUSN49hEjFEb0xn0",
       authDomain: "myapp.firebaseapp.com",
       databaseURL: "https://myapp.firebaseio.com",
       storageBucket: "myapp.appspot.com",
       messagingSenderId: "832108974830"
     });

    platform.ready().then(() => {
      statusBar.styleDefault();
      splashScreen.hide();
    });
  }
}

导入firebase及其依赖项后弹出错误。我现在处理这个错误超过24小时了。谢谢大家的帮助。

0 个答案:

没有答案