Skip to content

Instantly share code, notes, and snippets.

@guilbep
Last active August 29, 2015 13:56
Show Gist options
  • Save guilbep/9256215 to your computer and use it in GitHub Desktop.
Save guilbep/9256215 to your computer and use it in GitHub Desktop.
define(['resources/resources-module'], function(module) {
module.factory('lolRSRC', ['customResource', '$rootScope', '$q',
function(customResource, $rootScope, $q) {
var defer = $q.defer();
$rootScope.$on('$locationChangeSuccess', function(){
test.test();
});
var test = customResource(
apiUrl + "fafeeafe/:item", {
item: "@item"
}, {
get: {
method: "GET",
withCredentials: true,
timeout: defer.promise
}
});
test = angular.extend(test, {
"test" : function() {
defer.resolve("failure");
}
});
return test;
}
]);
return module;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment