如何在控制器中定义的功能成功时完全重新加载网页 [英] How can I reload a webpage completely on success of a function defined in the controller
问题描述
我有一个Angular JS制作的控制器,我希望在功能成功时重新加载整个网页。
我的功能是:
Hi,
I have a controller made in Angular JS and I want to reload the entire webpage on success of a function.
My function is :
moveToBench: function (employeeId) {
return $http.post(myApp.IndecommBaseUrl + '/Workflow?entityId=' + employeeId + '&nextStateId=' + myApp.state.bench)
}
任何人都可以帮助我?
我的尝试:
moveToBench:function(employeeId ){
返回$ http.post(myApp.IndecommBaseUrl +'/ Workflow?entityId ='+ employeeId +'& nextStateId ='+ myApp.state.bench)
.success(函数(数据){
$ route.reload();
});
}
Can anyone help me out?
What I have tried:
moveToBench: function (employeeId) {
return $http.post(myApp.IndecommBaseUrl + '/Workflow?entityId=' + employeeId + '&nextStateId=' + myApp.state.bench)
.success(function (data) {
$route.reload();
});
}
推荐答案
http.post(myApp.IndecommBaseUrl +'/ Workflow?entityId ='+ employeeId +'& nextStateId ='+ myApp.state.bench)
}
http.post(myApp.IndecommBaseUrl + '/Workflow?entityId=' + employeeId + '&nextStateId=' + myApp.state.bench) }
任何人都可以提供帮助我出去了吗?
我尝试了什么:
moveToBench:function (employeeId){
return
Can anyone help me out?
What I have tried:
moveToBench: function (employeeId) {
return
http.post(myApp.IndecommBaseUrl +'/ Workflow?entityId ='+ employeeId +'& nextStateId ='+ myApp .state.bench)
.success(函数(数据){
http.post(myApp.IndecommBaseUrl + '/Workflow?entityId=' + employeeId + '&nextStateId=' + myApp.state.bench)
.success(function (data) {
route.reload();
});
}
route.reload();
});
}
这篇关于如何在控制器中定义的功能成功时完全重新加载网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!