angular 神坑 ,回调函数无法被监视

原方法,使用一个confirm 点ok然后回调,结果  界面无法刷新,搜索了下 是因为$scope没有监视model,必须使用apply方法
  $scope.SelectedRow=row;
             negAlert.confirm(function(){
                 delCell();//数据已经被删除 但是界面没有刷新  
            },"Are you sure to remove this row?",false);

改为以下就ok了
  $scope.SelectedRow=row;
             negAlert.confirm(function(){
                 $scope.$apply(delCell);
            },"Are you sure to remove this row?",false);

引用:http://www.jb51.net/article/59538.htm

posted @ 2015-12-01 18:07  N1900  阅读(863)  评论(0编辑  收藏  举报