AngularJS Injector Error Uncaught Error: [$injector:modulerr]

AngularJS Injector Error Uncaught Error: [$injector:modulerr]

我是 AngularJS 的新手,我正在尝试遵循可扩展应用程序的一些结构,并尝试让 Firebase 正常工作。但是,我在喷油器上遇到了一个简单的错误。当我查看错误树时,它似乎都是 AngularJS 引用,而且我在我的代码中没有看到对对象的引用。我想我找错地方了?

Failed to instantiate module MyApp due to:
Error: [$injector:unpr] http://errors.angularjs.org/1.3.11/$injector/unpr?p0=e
    at Error (native)
    at     https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js:6:417
    at      https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js:38:307
    at d     (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js:36:308)
    at Object.e [as invoke]     (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js:37:64)
    at d     (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js:35:301)
    at     https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js:35:425
    at s     (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js:7:302)
    at g     (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js:35:202)
    at Ob     (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js:38:435

This is my Plunkr sample

你好像没听懂$scope

对于 routeProvider,它是 templateUrl 而不是 templateURL。对于TeamCtrl,如果要给View绑定一个对象,记得把这个对象添加到$scope.

angular.module('MyApp').config(function($routeProvider) {
    $routeProvider
    .when('/', {
        controller: 'TeamCtrl',
        templateUrl: 'team.html'
    })
    .otherwise({
        redirectTo: '/'
    });

});

angular.module('MyApp').controller('TeamCtrl', ['$scope', '$firebase', 'Teams', 
    function ($scope, $firebase, Teams) {

        $scope.Teams = Teams;
        $scope.team = {};

        $scope.SaveTeam = function(team) {
            $scope.Teams.$add({
                Id: $scope.team.id,
                Name: $scope.team.Name,
                Wins: $scope.team.Wins,
                Losses: $scope.team.Losses
            });
        };

        $scope.team.id = "";
        $scope.team.Name = "";
        $scope.team.Wins = "";
        $scope.team.Losses = "";
    }
]);

对于team.html

<div ng-repeat="team in Teams">
    <h2>{{team.Name}}</h2>
    {{team.Wins}} / {{team.Losses}}
</div>