我有以下简单的指令定义
<div>
<location-file-upload></location-file-upload>
<button ng-click="refresh()">Reload</button>
</div>
在Controller中,我们如何刷新以上指令?
$scope.refresh = function(){
//code here
}
答案 0 :(得分:1)
<div ng-if="reRender">
<location-file-upload></location-file-upload>
<button ng-click="refresh()">Reload</button>
</div>
$scope.refresh = function(){
$scope.reRender = false;
$timeout(function() {
$scope.reRender = true;
)};
}