Skip to content

Instantly share code, notes, and snippets.

@OrganicPanda
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OrganicPanda/01bea6293a942da90dd9 to your computer and use it in GitHub Desktop.
Save OrganicPanda/01bea6293a942da90dd9 to your computer and use it in GitHub Desktop.
Restangular Service
.factory('Search', function(Restangular, Me, constants) {
var profile = Restangular.one(constants.PROFILES, Me.get().view.of.id)
, serviceWithProfile = Restangular.service(constants.SEARCHES, profile)
, serviceNoProfile = Restangular.service(constants.SEARCHES);
serviceWithProfile.oneToOnes = function() {
return serviceWithProfile.getList({
searchType: constants.SEARCHES_ONE2ONE_TYPE
});
};
serviceWithProfile.automations = function() {
return serviceWithProfile.getList({
searchType: constants.SEARCHES_SIGNUP_AUTOMATION_TYPE
});
};
return serviceWithProfile;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment