Created
February 6, 2014 21:55
-
-
Save scardine/8853272 to your computer and use it in GitHub Desktop.
Model definition for Angular+Django rest framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/blacklocus/angular-django-rest-resource | |
angular.module('app.services', ['ngResource'], function($provide) { | |
$provide.factory('ModelName', function($resource) { | |
return djResource('/v1/model-name/pk:id/', {pk:'@id'}); | |
}); | |
$provide.factory('OtherModelName', function($resource) { | |
return djResource('/v1/other-model-name/pk:id/', {pk:'@id'}); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment