2014-10-28 34 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