I have a factory which call HomeNews and i want to make a preload div when the $resource is still process .
This is My ,Service File
(function() {
var newsServices;
newsServices = angular.module("newsServices", ["ngResource"]);
newsServices.factory("HomeNews", [
//I want to display a div when it's loading
"$resource", function($resource) {
return $resource("http://128.1.1.176/webservice/get_news_for_home.php?wscreen=" + windowWidth, {}, {
query: {
method: "GET",
isArray: false
//And I want to Hide the div when it's completed
}
});
}
]);
}).call(this);
This is My ,Controller File
(function() {
"use strict";
var newsControllers;
newsControllers = angular.module("newsControllers", []);
newsControllers.controller("HomeNewsListCtrl", [
"$scope", "HomeNews", "$location", function($scope, HomeNews, $location) {
$scope.news = HomeNews.query();
return $scope.go = function(path) {
return $location.path(path);
};
}
]);
}).call(this);