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