我创建了工厂,我在控制器中加载数据。我想创建加载数据的状态,就像正常的文本状态一样。我该怎么办?
var myApp = angular.module('myApp',[]);
myApp.controller('aukcjeController',function($scope,auctionFactory){
$scope.Data={};
$scope.get= function (data) {
auctionFactory.getOrders(data)
//somethink here ???
.progres(function(orders,status){
$scope.status = status
})
//???
.success(function (orders) {
$scope.Data= orders;
console.log($scope.Data);
$scope.dataLoaded=true;
})
.error(function (error) {
console.log(error);
});
};
// get();
});
myApp.factory('auctionFactory',function($http){
var fac = {};
fac.getOrders = function () {
return $http.get('file.php',{ cache: true});
};
return fac;
});