angular.module('flagsService',[]).factory('Flags',function($http){
	return {
		getPaging:function(filter){
			return $http({method:'POST',url:url_server + 'flagspaging',data:filter});
		},
		getSelect:function(){
			
			return $http({method:'POST',
						  headers:headers,
						  url:url_server+'flags/getall',
						  withCredentials: true});
			// return $http({method:'POST',url:url_server + 'flags/getall'});
		},
		getSelect2:function(filter){
			return $http({method:'POST',url:url_server + 'flags/search',data:filter});
		},
		show:function(id){
			return $http.get(url_server+ 'flags/'+id);
		},
		save:function(flagsData){
			return $http({method:'POST',
							url:url_server+'flags',
							data:flagsData});
		},
		update:function(id, flagsData){
			return $http.put(url_server+'flags/'+id,flagsData);
		},
		destroy:function(id){
			return $http.delete(url_server + 'flags/'+id);
		}
	};
});
