0
不知道我在這裏做錯了什麼。我通過npm需要我的模塊。除Firebase外,一切似乎都正確加載(角色等)。我得到這個錯誤:未能實例化模塊firebase
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/')
})();
任何想法我做錯了什麼?任何幫助表示讚賞。提前致謝!
這個錯誤非常簡單。 Angular說它找不到那個模塊,所以我的第一個問題是你在頁面上引用了哪些腳本? – Nick
只是一個'app.js'文件。我正在使用browserify捆綁該腳本文件。 – realph
難道你不需要一個單獨的腳本庫,angularfire,爲firebase [與角工作](https://www.firebase.com/docs/web/libraries/angular/quickstart.html)? – Nick