常见问题总结

一、select问题

点击修改出现select回显正常, 若继续点击修改,则发现select清空了或者要显示的内容闪一下没了,其他的依旧回显正常。解决方案如下:

伪代码1:

$scope.editInventoryView=function(acname){

certificateInventoryService.editInventoryView(id).success( function(responseData) {

//回显select

certificateInventoryService.getCydw().success( function(responseData) {

$scope.sites = [

{site : "Google", url : "http://www.google.com"},

{site : "Runoob", url : "http://www.runoob.com"},

{site : "Taobao", url : "http://www.taobao.com"}

];

$scope.selectedSite="http://www.taobao.com";

});

$state.go('certificate.inventory.editView');

});

}

伪代码2:

$scope.editInventoryView=function(acname){

certificateInventoryService.editInventoryView(id).success( function(responseData) {

//回显select

certificateInventoryService.getCydw().success( function(responseData) {

$scope.sites = [

{site : "Google", url : "http://www.google.com"},

{site : "Runoob", url : "http://www.runoob.com"},

{site : "Taobao", url : "http://www.taobao.com"}

];

$scope.selectedSite="http://www.taobao.com";

});

$state.go('certificate.inventory.editView');

});

}

猜你喜欢

转载自yingyingsheji.iteye.com/blog/2387022