Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
$window.Firebase不是构造函数错误消息,Firebase未加载_Firebase_Angularfire - Fatal编程技术网

$window.Firebase不是构造函数错误消息,Firebase未加载

$window.Firebase不是构造函数错误消息,Firebase未加载,firebase,angularfire,Firebase,Angularfire,我已经“正确”地设置了一切。使用AngularFire1版本1的内容不适用于AngularFire1版本2。我收到一条错误消息,上面说: $window.Firebase is not a constructor 守则: 我做对了的事情: 包括firebase.js和angularfire.js 将“firebase”添加到应用程序包含的库中 使用我的firebase配置文件的地址创建了firebase配置文件 创建了位于app/scripts/services/firebaseref.j

我已经“正确”地设置了一切。使用AngularFire1版本1的内容不适用于AngularFire1版本2。我收到一条错误消息,上面说:

$window.Firebase is not a constructor
守则:

我做对了的事情:

  • 包括firebase.js和angularfire.js
  • 将“firebase”添加到应用程序包含的库中
  • 使用我的firebase配置文件的地址创建了firebase配置文件
  • 创建了位于app/scripts/services/firebaseref.js的firebase参考文件
    'use strict';
    
    /**
     * @ngdoc overview
     * @name angularFireDemoApp
     * @description
     * # angularFireDemoApp
     *
     * Main module of the application.
     */
    angular
      .module('angularFireDemoApp', [
        'ngAnimate',
        'ngCookies',
        'ngResource',
        'ngRoute',
        'ngSanitize',
        'ngTouch',
        'firebase'
      ])
      .config(function ($routeProvider) {
        $routeProvider
          .when('/', {
            templateUrl: 'views/main.html',
            controller: 'MainCtrl',
            controllerAs: 'main'
          })
          .when('/about', {
            templateUrl: 'views/about.html',
            controller: 'AboutCtrl',
            controllerAs: 'about'
          })
          .otherwise({
            redirectTo: '/'
          });
      });
    
    'use strict';
    
    /**
     * @ngdoc service
     * @name angularFireDemoApp.FirebaseRef
     * @description
     * # FirebaseRef
     * Factory in the angularFireDemoApp.
     */
    angular.module('angularFireDemoApp')
        .factory('FirebaseRef', function ($window, FirebaseConfig) {
            return new $window.Firebase(FirebaseConfig);
        });
    
    'use strict';
    
    /**
     * @ngdoc service
     * @name angularFireDemoApp.FirebaseConfig
     * @description
     * # FirebaseConfig
     * Constant in the angularFireDemoApp.
     */
    angular.module('angularFireDemoApp')
      .constant('FirebaseConfig', 'https://enviedsolutionsangularfire.firebaseio.com');