Closed searope closed 9 years ago
The expression you're passing to cg-busy is evaluating to a string, not a promise. Thats why you're getting that error. Do this:
$scope.loadRow(link){
if (!$scope.promises) {
$scope.promises = {};
}
$scope.promises['p'+link.fromId+'-'+link.toId] = $http.get('...');
}
<div ng-repeat="link in table">
<div ng-click="loadRow(link)">
<div cg-busy="promises['p'+link.fromId+'-'+link.toId]"></div>
</div>
</div>
thank you!
Hello, I have a table loaded dynamically and its rows can be expanded with AJAX calls on user clicks. I'd like to show spinner while these secondary data is loaded. But I cannot use one promise variable for that since it shows the spinner in all rows. So I've tried to create the promise variables on the fly when the parent table is loaded. But when I try to access the dynamic variables I'm getting the error in the subject. How could I work around this? html:
js: