首次單擊按鈕時,它將重定向到指定的位置,但稍後單擊它將被重定向到登錄表單。我完全卡住..請幫助。使用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添加了額外文本的地方。但不知道,一旦你顯示你的代碼,那麼我們就可以解決它 –