Angular 路由 UI-路由问题

Angular Routing with UI-route issue

我是 Angular 的新人,我一直在关注 this tutorial。一切进展顺利,直到我到达 Angular 路由应该发生的部分。我找不到错误。如果有人能帮助我,那就太好了! 这是 plunker.

这是应用程序 (app3.js):

var app = angular.module('futbol', ['ui.router'])        
    app.factory('jugadores', [function(){
      var o = {
        jugadores: []
        /*jugadores: [
          {nombre: 'Hernan', goles: 5},
          {nombre: 'Ricardo', goles: 2},
          {nombre: 'Tiago', goles: 15},
          {nombre: 'Marcelo', goles: 9},
          {nombre: 'German', goles: 4}
        ];*/
      };
      return o;
    }])
    app.controller('MainCtrl', [
    '$scope',
    'jugadores',
    function($scope,jugadores){
        $scope.jugadores = jugadores.jugadores;
        $scope.test = 'HOLA!';
        $scope.addJugador = function(){
          $scope.jugadores.push({nombre: $scope.nombre, goles: 0});
          $scope.nombre = '';
        };
        $scope.incrementGoles = function(jugador) {
          jugador.goles += 1;
        };
    }]);
    app.config(['$stateProvider','$urlRouterProvider',
    function($stateProvider, $urlRouterProvider) {

      $stateProvider
        .state('home', {
          url: '/home',
          templateUrl: '/home.html',
          controller: 'MainCtrl'
        });

      $urlRouterProvider.otherwise('home');
    }]);

前往 plunker link 查看 HTML。

谢谢

updated and running plunker

要做到 运行 我们需要根 anchor/target ui-view="" 作为我们的状态:

<body ng-app="futbol">  

    <div ui-view=""></div>

此外,这应该是 (不仅仅是 'home'):

$urlRouterProvider.otherwise('/home');

它说哪个 url 应该用作默认...