Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 6ac773f

Browse files
docs(): fix jshint issues
1 parent 3174f73 commit 6ac773f

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

src/ngResource/resource.js

+26-25
Original file line numberDiff line numberDiff line change
@@ -276,31 +276,32 @@ function shallowClearAndCopy(src, dst) {
276276
* @example
277277
* # Creating a custom 'PUT' request
278278
* In this example we create a custom method on our resource to make a PUT request
279-
<pre>
280-
var app = angular.module('app', ['ngResource', 'ngRoute']);
281-
282-
// Some APIs expect a PUT request in the format URL/object/ID
283-
// Here we are creating an 'update' method
284-
app.factory('Notes', ['$resource', function($resource) {
285-
return $resource('/notes/:id', null,
286-
{
287-
'update': { method:'PUT' }
288-
});
289-
}]);
290-
291-
// In our controller we get the ID from the URL using ngRoute and $routeParams
292-
// We pass in $routeParams and our Notes factory along with $scope
293-
app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes', function($scope, $routeParams, Notes) {
294-
// First get a note object from the factory
295-
var note = Notes.get({ id:$routeParams.id });
296-
$id = note.id;
297-
298-
// Now call update passing in the ID first then the object you are updating
299-
Notes.update({ id:$id }, note);
300-
301-
// This will PUT /notes/ID with the note object in the request payload
302-
}]);
303-
</pre>
279+
* <pre>
280+
* var app = angular.module('app', ['ngResource', 'ngRoute']);
281+
*
282+
* // Some APIs expect a PUT request in the format URL/object/ID
283+
* // Here we are creating an 'update' method
284+
* app.factory('Notes', ['$resource', function($resource) {
285+
* return $resource('/notes/:id', null,
286+
* {
287+
* 'update': { method:'PUT' }
288+
* });
289+
* }]);
290+
*
291+
* // In our controller we get the ID from the URL using ngRoute and $routeParams
292+
* // We pass in $routeParams and our Notes factory along with $scope
293+
* app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes',
294+
function($scope, $routeParams, Notes) {
295+
* // First get a note object from the factory
296+
* var note = Notes.get({ id:$routeParams.id });
297+
* $id = note.id;
298+
*
299+
* // Now call update passing in the ID first then the object you are updating
300+
* Notes.update({ id:$id }, note);
301+
*
302+
* // This will PUT /notes/ID with the note object in the request payload
303+
* }]);
304+
* </pre>
304305
*/
305306
angular.module('ngResource', ['ng']).
306307
factory('$resource', ['$http', '$q', function($http, $q) {

0 commit comments

Comments
 (0)