首次单击按钮时,它将重定向到指定的位置,但稍后单击它将被重定向到登录表单。我完全卡住..请帮助。使用location.path重定向()
$scope.edit = function() {
$location.path('/Appointment');
}
$stateProvider.state('Appointment', {
url: '/Appointment',
parent: 'common',
templateUrl: 'templates/Appointment.html',
controller: 'AppointmentCtrl'
});
$ urlRouterProvider.otherwise( '/登录');
问题可能是你的'run'块或'AppointmentCtrl'。因此添加更多代码 –
您是否可以通过示例代码片段重现问题? – Nitheesh
可能是URL添加了额外文本的地方。但不知道,一旦你显示你的代码,那么我们就可以解决它 –