无法实例化模块 firebase
Failed to instantiate module firebase
不确定我做错了什么。我通过 npm 需要我的模块。除了 Firebase 之外,一切似乎都正确加载(angular 等)。我收到此错误:
Error: [$injector:modulerr] Failed to instantiate module firebase due to:
Error: [$injector:nomod] Module 'firebase' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
我需要 Firebase 就像我的其他模块一样。这是我的代码的样子:
(function() {
'use strict';
var angular = require('angular');
var angularRoute = require('angular-route');
var angularTouch = require('angular-touch');
var Firebase = require('firebase');
angular.module('outcomesApp', ['ngTouch', 'ngRoute', 'firebase'])
.controller('UnitController', ['$scope', '$http', 'FBURL', function($scope, $http, FBURL){
}])
.constant('FBURL', 'https://new-outcomes.firebaseio.com/')
})();
知道我做错了什么吗?任何帮助表示赞赏。提前致谢!
您需要包含对 AngularFire 库的引用。那是定义 angular 模块的地方。
不确定我做错了什么。我通过 npm 需要我的模块。除了 Firebase 之外,一切似乎都正确加载(angular 等)。我收到此错误:
Error: [$injector:modulerr] Failed to instantiate module firebase due to:
Error: [$injector:nomod] Module 'firebase' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
我需要 Firebase 就像我的其他模块一样。这是我的代码的样子:
(function() {
'use strict';
var angular = require('angular');
var angularRoute = require('angular-route');
var angularTouch = require('angular-touch');
var Firebase = require('firebase');
angular.module('outcomesApp', ['ngTouch', 'ngRoute', 'firebase'])
.controller('UnitController', ['$scope', '$http', 'FBURL', function($scope, $http, FBURL){
}])
.constant('FBURL', 'https://new-outcomes.firebaseio.com/')
})();
知道我做错了什么吗?任何帮助表示赞赏。提前致谢!
您需要包含对 AngularFire 库的引用。那是定义 angular 模块的地方。