diff options
| author | Pete Bacon Darwin | 2013-12-17 12:29:22 +0000 | 
|---|---|---|
| committer | Pete Bacon Darwin | 2013-12-17 12:29:22 +0000 | 
| commit | 6ac773f350a3eacb5f4b3ab83bc06e3568ac8005 (patch) | |
| tree | b82506769edb698137a5b92360f9bcef02d84247 /src/ngResource | |
| parent | 3174f7333672c96613825976c883f79ad4d41016 (diff) | |
| download | angular.js-6ac773f350a3eacb5f4b3ab83bc06e3568ac8005.tar.bz2 | |
docs(): fix jshint issues
Diffstat (limited to 'src/ngResource')
| -rw-r--r-- | src/ngResource/resource.js | 51 | 
1 files changed, 26 insertions, 25 deletions
| diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 3172096f..281dd4ac 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -276,31 +276,32 @@ function shallowClearAndCopy(src, dst) {   * @example   * # Creating a custom 'PUT' request   * In this example we create a custom method on our resource to make a PUT request - 	<pre> -		var app = angular.module('app', ['ngResource', 'ngRoute']); - -		// Some APIs expect a PUT request in the format URL/object/ID -		// Here we are creating an 'update' method  -		app.factory('Notes', ['$resource', function($resource) { -		    return $resource('/notes/:id', null, -		        { -		            'update': { method:'PUT' } -		        }); -		}]); - -		// In our controller we get the ID from the URL using ngRoute and $routeParams -		// We pass in $routeParams and our Notes factory along with $scope -		app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes', function($scope, $routeParams, Notes) { -		    // First get a note object from the factory -		    var note = Notes.get({ id:$routeParams.id }); -		    $id = note.id; - -		    // Now call update passing in the ID first then the object you are updating -		    Notes.update({ id:$id }, note); - -		    // This will PUT /notes/ID with the note object in the request payload -		}]); - 	</pre> + * <pre> + *		var app = angular.module('app', ['ngResource', 'ngRoute']); + * + *		// Some APIs expect a PUT request in the format URL/object/ID + *		// Here we are creating an 'update' method  + *		app.factory('Notes', ['$resource', function($resource) { + *    return $resource('/notes/:id', null, + *        { + *            'update': { method:'PUT' } + *        }); + *		}]); + * + *		// In our controller we get the ID from the URL using ngRoute and $routeParams + *		// We pass in $routeParams and our Notes factory along with $scope + *		app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes', +                                      function($scope, $routeParams, Notes) { + *    // First get a note object from the factory + *    var note = Notes.get({ id:$routeParams.id }); + *    $id = note.id; + * + *    // Now call update passing in the ID first then the object you are updating + *    Notes.update({ id:$id }, note); + * + *    // This will PUT /notes/ID with the note object in the request payload + *		}]); + * </pre>   */  angular.module('ngResource', ['ng']).    factory('$resource', ['$http', '$q', function($http, $q) { | 
