【发布时间】:2014-07-17 03:35:25
【问题描述】:
$location.path('/user/logout');
此行在控制台中收到错误Uncaught SyntaxError: Unexpected token .。当该行被评论时,它就会发生。请问我的代码有什么问题。
angular.module('symphony', ['ngRoute'])
.config(function($routeProvider, $locationProvider, $location) {
$routeProvider
.when('/user', {
templateUrl: '/angular/pages/user.php',
controller: enterpriseController,
})
.when('/modules', {
templateUrl: '/angular/pages/merchant/dash.php',
controller: merchantController,
})
.when('/user/logout', {
$location.path('/user/logout');
});
$locationProvider.html5Mode(true);
});
【问题讨论】:
标签: angularjs