AngularJS Dojo - Using $resource