我有读取资源数据的服务
服务:
function ComplaintPageService ($log, customService) {
'use strict';
var Service = function() {
this.load = function load(controller, scope) {
// TODO define configuration
var loadConfig = [
{ name: 'priorities'}
];
return customService.load(controller, loadConfig);
};
};
return new Service();
}
然后在控制器中console.log示波器。
function ComplaintPageController($log, $scope, complaintPageService) {
'use strict';
var promises = complaintPageService.load(this, $scope);
console.log(promises);
console.log($scope);
}
The console log (click this is this important!)
如何轻松地从PrioritiesResource中提取数据?