角度和单击列表项

时间:2016-12-13 21:21:25

标签: javascript angularjs

我试图理解为什么当我点击此列表项时,它不想转到相应的页面。相反,它会恢复到主页面。

<li ng-click="goToPage('#/show-schedule')">Schedule</li>

angular
.module('CaliforniaJam', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ngTouch',
    'ngFileUpload',
    'simplePagination',
    'ui.bootstrap',
    'ngTouch',
    //'mobile-angular-ui'
])
.config(function ($routeProvider) {
    $routeProvider
        .when('/show-schedule', {
            templateUrl: 'views/show-schedule.html',
            controller: 'ShowScheduleCtrl',
            controllerAs: 'ShowScheduleCtrl'
         .otherwise({
            redirectTo: '/'
         });
});


$scope.goToPage = function(url) {
        $rootScope.transition('slide', 'left', url);
    }

0 个答案:

没有答案