2014-10-28 76 views
0

我正在嘗試使用「angular-busy」,並且在將['cgBusy']添加到角度模塊時會中斷。角度繁忙的簡單實現有什麼問題?

任何人都可以看到這是怎麼回事?我想顯示加載微調使用$ HTTP服務時,數據被取出:

$scope.promise = $http({ 
method: 'JSONP', 
url: nprUrl + '&apiKey=' + apiKey + '&callback=JSON_CALLBACK' 
}).success(function(data, status) { 
    alert('success'); 
// Store the list of stories on the scope 
// from the NPR API response object (described above) 
$scope.programs = data.list.story; 
}).error(function(data, status) { 
// Some error occurred 
alert('fail'); 
}); 

這裏是我的plnker代碼:

http://plnkr.co/edit/wXHdMpiyhHSVTtncorYD?p=preview

回答

2

兩件事情

  1. 你有包括angular-busy.jsindex.html
  2. 您的承諾被稱爲promisemyPromise

工作例如:

http://plnkr.co/edit/PLCs4S3ih8eD4mQuZOAl?p=preview

+0

謝謝你提供的,是的,我錯過了諾言/ myPromise的事情,我一直在想一些事情。哎呀忘了包括!謝謝 :) – user1532669 2014-10-28 16:54:45