我正在尝试将AngularJS 1.6用于我的网站,并使用ng-route进行路由(因为我真的不知道ui-router) . 我的问题是我有很多链接和一个带参数的链接:

.when("/", {
            templateUrl : "pages/indexView.html"
        })
        .when("/index", {
            templateUrl : "pages/indexView.html"
        })
        .when("/services", {
            templateUrl : "pages/services.html"
        })
        .when....
        .when("/teams/:team", {
            templateUrl : "pages/teams.html",
            controller : 'TeamsCtrl'
        })
        .otherwise({
            redirect: '/pages/404.html'
        });

控制器TeamsCtrl有一些参数“:team”的条件:

$scope.team = $routeParams.team;

        if($scope.team == 'abc'){
            $scope.Subtitle = 'abc';
            $scope.Description = '';
        } else if ($scope.team == 'fgh'){
            $scope.Subtitle = 'fghfhs';
            $scope.Description = '';                
        } else if ...

问题是当我第一次登陆网站时,我可以点击“团队链接”中的任何链接,但是如果我点击任何其他链接,所有“团队的链接”都不会运行任何东西(另一方面)手其他链接仍然很好用) .

Ps:链接看起来像:普通链接的href =“#!services”和“团队链接”的href =“#!teams / abc” .

你知道什么可以提供这个bug吗?你需要更多的东西来帮助我吗?

谢谢 .