$window.Firebase不是构造函数错误消息,Firebase未加载
我已经“正确”地设置了一切。使用AngularFire1版本1的内容不适用于AngularFire1版本2。我收到一条错误消息,上面说:$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
$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');