。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
$http({
method:'POST',
dataType: 'json',
url:'/answer/modifyAnswerRequest.html',
params:{questionId:questionId,questionAnswerId:questionAnswerId,questionTitle:questionTitle,questionContent:questionContent,answerContent:answerContent,answerType:KDDT_STATE},
}).then(function successCallback(response) {
if("-1" == response.data.result){
alert("服务器加载中");
}else if("1" == response.data.result){
alert("修改题目信息成功");
window.location.href = "/answer/AnswerGrid.html";
}
//alert(angular.toJson(response.data));
}, function errorCallback(response) {
alert("输入信息为空或不正确");
});
用window.location.href试试
你切换路由的时候伴随着请求数据,重新渲染页面,你的需求其实可以用状态管理工具解决,angularjs的话推荐 ng-redux ,你将查询条件的状态存到 store 里去,然后跳转回来再从 store 取出来赋值进去,实现跨组件跨页面的传输,类似的库还有 Flux(不推荐使用)
用状态管理工具解决就可以了