angularjs-rails 1.2.26 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/angularjs-rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/angular-animate.js +879 -456
  4. data/vendor/assets/javascripts/angular-aria.js +250 -0
  5. data/vendor/assets/javascripts/angular-cookies.js +1 -1
  6. data/vendor/assets/javascripts/angular-loader.js +17 -10
  7. data/vendor/assets/javascripts/angular-messages.js +400 -0
  8. data/vendor/assets/javascripts/angular-mocks.js +220 -110
  9. data/vendor/assets/javascripts/angular-resource.js +287 -247
  10. data/vendor/assets/javascripts/angular-route.js +111 -54
  11. data/vendor/assets/javascripts/angular-sanitize.js +1 -1
  12. data/vendor/assets/javascripts/angular-scenario.js +11579 -8665
  13. data/vendor/assets/javascripts/angular-touch.js +49 -11
  14. data/vendor/assets/javascripts/angular.js +6660 -3106
  15. data/vendor/assets/javascripts/unstable/angular-animate.js +240 -71
  16. data/vendor/assets/javascripts/unstable/angular-aria.js +12 -12
  17. data/vendor/assets/javascripts/unstable/angular-cookies.js +1 -1
  18. data/vendor/assets/javascripts/unstable/angular-loader.js +4 -4
  19. data/vendor/assets/javascripts/unstable/angular-messages.js +1 -1
  20. data/vendor/assets/javascripts/unstable/angular-mocks.js +21 -14
  21. data/vendor/assets/javascripts/unstable/angular-resource.js +2 -2
  22. data/vendor/assets/javascripts/unstable/angular-route.js +1 -1
  23. data/vendor/assets/javascripts/unstable/angular-sanitize.js +1 -1
  24. data/vendor/assets/javascripts/unstable/angular-scenario.js +562 -262
  25. data/vendor/assets/javascripts/unstable/angular-touch.js +1 -1
  26. data/vendor/assets/javascripts/unstable/angular.js +562 -262
  27. metadata +16 -14
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.26
2
+ * @license AngularJS v1.3.0
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -78,6 +78,18 @@ function shallowClearAndCopy(src, dst) {
78
78
  *
79
79
  * Requires the {@link ngResource `ngResource`} module to be installed.
80
80
  *
81
+ * By default, trailing slashes will be stripped from the calculated URLs,
82
+ * which can pose problems with server backends that do not expect that
83
+ * behavior. This can be disabled by configuring the `$resourceProvider` like
84
+ * this:
85
+ *
86
+ * ```js
87
+ app.config(['$resourceProvider', function ($resourceProvider) {
88
+ // Don't strip trailing slashes from calculated URLs
89
+ $resourceProvider.defaults.stripTrailingSlashes = false;
90
+ }]);
91
+ * ```
92
+ *
81
93
  * @param {string} url A parametrized URL template with parameters prefixed by `:` as in
82
94
  * `/user/:username`. If you are using a URL with a port number (e.g.
83
95
  * `http://example.com:8080/api`), it will be respected.
@@ -106,7 +118,7 @@ function shallowClearAndCopy(src, dst) {
106
118
  *
107
119
  * @param {Object.<Object>=} actions Hash with declaration of custom action that should extend
108
120
  * the default set of resource actions. The declaration should be created in the format of {@link
109
- * ng.$http#usage_parameters $http.config}:
121
+ * ng.$http#usage $http.config}:
110
122
  *
111
123
  * {action1: {method:?, params:?, isArray:?, headers:?, ...},
112
124
  * action2: {method:?, params:?, isArray:?, headers:?, ...},
@@ -155,6 +167,14 @@ function shallowClearAndCopy(src, dst) {
155
167
  * `response` and `responseError`. Both `response` and `responseError` interceptors get called
156
168
  * with `http response` object. See {@link ng.$http $http interceptors}.
157
169
  *
170
+ * @param {Object} options Hash with custom settings that should extend the
171
+ * default `$resourceProvider` behavior. The only supported option is
172
+ *
173
+ * Where:
174
+ *
175
+ * - **`stripTrailingSlashes`** – {boolean} – If true then the trailing
176
+ * slashes from any calculated URL will be stripped. (Defaults to true.)
177
+ *
158
178
  * @returns {Object} A resource "class" object with methods for the default set of resource actions
159
179
  * optionally extended with custom `actions`. The default set contains these actions:
160
180
  * ```js
@@ -330,298 +350,318 @@ function shallowClearAndCopy(src, dst) {
330
350
  * ```
331
351
  */
332
352
  angular.module('ngResource', ['ng']).
333
- factory('$resource', ['$http', '$q', function($http, $q) {
334
-
335
- var DEFAULT_ACTIONS = {
336
- 'get': {method:'GET'},
337
- 'save': {method:'POST'},
338
- 'query': {method:'GET', isArray:true},
339
- 'remove': {method:'DELETE'},
340
- 'delete': {method:'DELETE'}
353
+ provider('$resource', function () {
354
+ var provider = this;
355
+
356
+ this.defaults = {
357
+ // Strip slashes by default
358
+ stripTrailingSlashes: true,
359
+
360
+ // Default actions configuration
361
+ actions: {
362
+ 'get': {method: 'GET'},
363
+ 'save': {method: 'POST'},
364
+ 'query': {method: 'GET', isArray: true},
365
+ 'remove': {method: 'DELETE'},
366
+ 'delete': {method: 'DELETE'}
367
+ }
341
368
  };
342
- var noop = angular.noop,
369
+
370
+ this.$get = ['$http', '$q', function ($http, $q) {
371
+
372
+ var noop = angular.noop,
343
373
  forEach = angular.forEach,
344
374
  extend = angular.extend,
345
375
  copy = angular.copy,
346
376
  isFunction = angular.isFunction;
347
377
 
348
- /**
349
- * We need our custom method because encodeURIComponent is too aggressive and doesn't follow
350
- * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
351
- * segments:
352
- * segment = *pchar
353
- * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
354
- * pct-encoded = "%" HEXDIG HEXDIG
355
- * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
356
- * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
357
- * / "*" / "+" / "," / ";" / "="
358
- */
359
- function encodeUriSegment(val) {
360
- return encodeUriQuery(val, true).
361
- replace(/%26/gi, '&').
362
- replace(/%3D/gi, '=').
363
- replace(/%2B/gi, '+');
364
- }
378
+ /**
379
+ * We need our custom method because encodeURIComponent is too aggressive and doesn't follow
380
+ * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set
381
+ * (pchar) allowed in path segments:
382
+ * segment = *pchar
383
+ * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
384
+ * pct-encoded = "%" HEXDIG HEXDIG
385
+ * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
386
+ * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
387
+ * / "*" / "+" / "," / ";" / "="
388
+ */
389
+ function encodeUriSegment(val) {
390
+ return encodeUriQuery(val, true).
391
+ replace(/%26/gi, '&').
392
+ replace(/%3D/gi, '=').
393
+ replace(/%2B/gi, '+');
394
+ }
365
395
 
366
396
 
367
- /**
368
- * This method is intended for encoding *key* or *value* parts of query component. We need a
369
- * custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't
370
- * have to be encoded per http://tools.ietf.org/html/rfc3986:
371
- * query = *( pchar / "/" / "?" )
372
- * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
373
- * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
374
- * pct-encoded = "%" HEXDIG HEXDIG
375
- * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
376
- * / "*" / "+" / "," / ";" / "="
377
- */
378
- function encodeUriQuery(val, pctEncodeSpaces) {
379
- return encodeURIComponent(val).
380
- replace(/%40/gi, '@').
381
- replace(/%3A/gi, ':').
382
- replace(/%24/g, '$').
383
- replace(/%2C/gi, ',').
384
- replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
385
- }
397
+ /**
398
+ * This method is intended for encoding *key* or *value* parts of query component. We need a
399
+ * custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't
400
+ * have to be encoded per http://tools.ietf.org/html/rfc3986:
401
+ * query = *( pchar / "/" / "?" )
402
+ * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
403
+ * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
404
+ * pct-encoded = "%" HEXDIG HEXDIG
405
+ * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
406
+ * / "*" / "+" / "," / ";" / "="
407
+ */
408
+ function encodeUriQuery(val, pctEncodeSpaces) {
409
+ return encodeURIComponent(val).
410
+ replace(/%40/gi, '@').
411
+ replace(/%3A/gi, ':').
412
+ replace(/%24/g, '$').
413
+ replace(/%2C/gi, ',').
414
+ replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
415
+ }
386
416
 
387
- function Route(template, defaults) {
388
- this.template = template;
389
- this.defaults = defaults || {};
390
- this.urlParams = {};
391
- }
417
+ function Route(template, defaults) {
418
+ this.template = template;
419
+ this.defaults = extend({}, provider.defaults, defaults);
420
+ this.urlParams = {};
421
+ }
392
422
 
393
- Route.prototype = {
394
- setUrlParams: function(config, params, actionUrl) {
395
- var self = this,
423
+ Route.prototype = {
424
+ setUrlParams: function (config, params, actionUrl) {
425
+ var self = this,
396
426
  url = actionUrl || self.template,
397
427
  val,
398
428
  encodedVal;
399
429
 
400
- var urlParams = self.urlParams = {};
401
- forEach(url.split(/\W/), function(param){
402
- if (param === 'hasOwnProperty') {
403
- throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
404
- }
405
- if (!(new RegExp("^\\d+$").test(param)) && param &&
406
- (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) {
407
- urlParams[param] = true;
408
- }
409
- });
410
- url = url.replace(/\\:/g, ':');
411
-
412
- params = params || {};
413
- forEach(self.urlParams, function(_, urlParam){
414
- val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
415
- if (angular.isDefined(val) && val !== null) {
416
- encodedVal = encodeUriSegment(val);
417
- url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
418
- return encodedVal + p1;
419
- });
420
- } else {
421
- url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
422
- leadingSlashes, tail) {
423
- if (tail.charAt(0) == '/') {
424
- return tail;
425
- } else {
426
- return leadingSlashes + tail;
427
- }
428
- });
429
- }
430
- });
430
+ var urlParams = self.urlParams = {};
431
+ forEach(url.split(/\W/), function (param) {
432
+ if (param === 'hasOwnProperty') {
433
+ throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
434
+ }
435
+ if (!(new RegExp("^\\d+$").test(param)) && param &&
436
+ (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) {
437
+ urlParams[param] = true;
438
+ }
439
+ });
440
+ url = url.replace(/\\:/g, ':');
441
+
442
+ params = params || {};
443
+ forEach(self.urlParams, function (_, urlParam) {
444
+ val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
445
+ if (angular.isDefined(val) && val !== null) {
446
+ encodedVal = encodeUriSegment(val);
447
+ url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function (match, p1) {
448
+ return encodedVal + p1;
449
+ });
450
+ } else {
451
+ url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function (match,
452
+ leadingSlashes, tail) {
453
+ if (tail.charAt(0) == '/') {
454
+ return tail;
455
+ } else {
456
+ return leadingSlashes + tail;
457
+ }
458
+ });
459
+ }
460
+ });
431
461
 
432
- // strip trailing slashes and set the url
433
- url = url.replace(/\/+$/, '') || '/';
434
- // then replace collapse `/.` if found in the last URL path segment before the query
435
- // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
436
- url = url.replace(/\/\.(?=\w+($|\?))/, '.');
437
- // replace escaped `/\.` with `/.`
438
- config.url = url.replace(/\/\\\./, '/.');
462
+ // strip trailing slashes and set the url (unless this behavior is specifically disabled)
463
+ if (self.defaults.stripTrailingSlashes) {
464
+ url = url.replace(/\/+$/, '') || '/';
465
+ }
439
466
 
467
+ // then replace collapse `/.` if found in the last URL path segment before the query
468
+ // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
469
+ url = url.replace(/\/\.(?=\w+($|\?))/, '.');
470
+ // replace escaped `/\.` with `/.`
471
+ config.url = url.replace(/\/\\\./, '/.');
440
472
 
441
- // set params - delegate param encoding to $http
442
- forEach(params, function(value, key){
443
- if (!self.urlParams[key]) {
444
- config.params = config.params || {};
445
- config.params[key] = value;
446
- }
447
- });
448
- }
449
- };
450
473
 
474
+ // set params - delegate param encoding to $http
475
+ forEach(params, function (value, key) {
476
+ if (!self.urlParams[key]) {
477
+ config.params = config.params || {};
478
+ config.params[key] = value;
479
+ }
480
+ });
481
+ }
482
+ };
451
483
 
452
- function resourceFactory(url, paramDefaults, actions) {
453
- var route = new Route(url);
454
484
 
455
- actions = extend({}, DEFAULT_ACTIONS, actions);
485
+ function resourceFactory(url, paramDefaults, actions, options) {
486
+ var route = new Route(url, options);
456
487
 
457
- function extractParams(data, actionParams){
458
- var ids = {};
459
- actionParams = extend({}, paramDefaults, actionParams);
460
- forEach(actionParams, function(value, key){
461
- if (isFunction(value)) { value = value(); }
462
- ids[key] = value && value.charAt && value.charAt(0) == '@' ?
463
- lookupDottedPath(data, value.substr(1)) : value;
464
- });
465
- return ids;
466
- }
488
+ actions = extend({}, provider.defaults.actions, actions);
467
489
 
468
- function defaultResponseInterceptor(response) {
469
- return response.resource;
470
- }
490
+ function extractParams(data, actionParams) {
491
+ var ids = {};
492
+ actionParams = extend({}, paramDefaults, actionParams);
493
+ forEach(actionParams, function (value, key) {
494
+ if (isFunction(value)) { value = value(); }
495
+ ids[key] = value && value.charAt && value.charAt(0) == '@' ?
496
+ lookupDottedPath(data, value.substr(1)) : value;
497
+ });
498
+ return ids;
499
+ }
500
+
501
+ function defaultResponseInterceptor(response) {
502
+ return response.resource;
503
+ }
504
+
505
+ function Resource(value) {
506
+ shallowClearAndCopy(value || {}, this);
507
+ }
508
+
509
+ Resource.prototype.toJSON = function () {
510
+ var data = extend({}, this);
511
+ delete data.$promise;
512
+ delete data.$resolved;
513
+ return data;
514
+ };
471
515
 
472
- function Resource(value){
473
- shallowClearAndCopy(value || {}, this);
474
- }
516
+ forEach(actions, function (action, name) {
517
+ var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
475
518
 
476
- forEach(actions, function(action, name) {
477
- var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
478
-
479
- Resource[name] = function(a1, a2, a3, a4) {
480
- var params = {}, data, success, error;
481
-
482
- /* jshint -W086 */ /* (purposefully fall through case statements) */
483
- switch(arguments.length) {
484
- case 4:
485
- error = a4;
486
- success = a3;
487
- //fallthrough
488
- case 3:
489
- case 2:
490
- if (isFunction(a2)) {
491
- if (isFunction(a1)) {
492
- success = a1;
493
- error = a2;
494
- break;
495
- }
519
+ Resource[name] = function (a1, a2, a3, a4) {
520
+ var params = {}, data, success, error;
496
521
 
497
- success = a2;
498
- error = a3;
522
+ /* jshint -W086 */ /* (purposefully fall through case statements) */
523
+ switch (arguments.length) {
524
+ case 4:
525
+ error = a4;
526
+ success = a3;
499
527
  //fallthrough
500
- } else {
501
- params = a1;
502
- data = a2;
503
- success = a3;
504
- break;
505
- }
506
- case 1:
507
- if (isFunction(a1)) success = a1;
508
- else if (hasBody) data = a1;
509
- else params = a1;
510
- break;
511
- case 0: break;
512
- default:
513
- throw $resourceMinErr('badargs',
514
- "Expected up to 4 arguments [params, data, success, error], got {0} arguments",
515
- arguments.length);
516
- }
517
- /* jshint +W086 */ /* (purposefully fall through case statements) */
518
-
519
- var isInstanceCall = this instanceof Resource;
520
- var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));
521
- var httpConfig = {};
522
- var responseInterceptor = action.interceptor && action.interceptor.response ||
523
- defaultResponseInterceptor;
524
- var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||
525
- undefined;
526
-
527
- forEach(action, function(value, key) {
528
- if (key != 'params' && key != 'isArray' && key != 'interceptor') {
529
- httpConfig[key] = copy(value);
530
- }
531
- });
528
+ case 3:
529
+ case 2:
530
+ if (isFunction(a2)) {
531
+ if (isFunction(a1)) {
532
+ success = a1;
533
+ error = a2;
534
+ break;
535
+ }
532
536
 
533
- if (hasBody) httpConfig.data = data;
534
- route.setUrlParams(httpConfig,
535
- extend({}, extractParams(data, action.params || {}), params),
536
- action.url);
537
-
538
- var promise = $http(httpConfig).then(function (response) {
539
- var data = response.data,
540
- promise = value.$promise;
541
-
542
- if (data) {
543
- // Need to convert action.isArray to boolean in case it is undefined
544
- // jshint -W018
545
- if (angular.isArray(data) !== (!!action.isArray)) {
546
- throw $resourceMinErr('badcfg',
547
- 'Error in resource configuration. Expected ' +
548
- 'response to contain an {0} but got an {1}',
549
- action.isArray ? 'array' : 'object',
550
- angular.isArray(data) ? 'array' : 'object');
537
+ success = a2;
538
+ error = a3;
539
+ //fallthrough
540
+ } else {
541
+ params = a1;
542
+ data = a2;
543
+ success = a3;
544
+ break;
545
+ }
546
+ case 1:
547
+ if (isFunction(a1)) success = a1;
548
+ else if (hasBody) data = a1;
549
+ else params = a1;
550
+ break;
551
+ case 0: break;
552
+ default:
553
+ throw $resourceMinErr('badargs',
554
+ "Expected up to 4 arguments [params, data, success, error], got {0} arguments",
555
+ arguments.length);
556
+ }
557
+ /* jshint +W086 */ /* (purposefully fall through case statements) */
558
+
559
+ var isInstanceCall = this instanceof Resource;
560
+ var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));
561
+ var httpConfig = {};
562
+ var responseInterceptor = action.interceptor && action.interceptor.response ||
563
+ defaultResponseInterceptor;
564
+ var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||
565
+ undefined;
566
+
567
+ forEach(action, function (value, key) {
568
+ if (key != 'params' && key != 'isArray' && key != 'interceptor') {
569
+ httpConfig[key] = copy(value);
551
570
  }
552
- // jshint +W018
553
- if (action.isArray) {
554
- value.length = 0;
555
- forEach(data, function (item) {
556
- if (typeof item === "object") {
557
- value.push(new Resource(item));
558
- } else {
559
- // Valid JSON values may be string literals, and these should not be converted
560
- // into objects. These items will not have access to the Resource prototype
561
- // methods, but unfortunately there
562
- value.push(item);
563
- }
564
- });
565
- } else {
566
- shallowClearAndCopy(data, value);
567
- value.$promise = promise;
571
+ });
572
+
573
+ if (hasBody) httpConfig.data = data;
574
+ route.setUrlParams(httpConfig,
575
+ extend({}, extractParams(data, action.params || {}), params),
576
+ action.url);
577
+
578
+ var promise = $http(httpConfig).then(function (response) {
579
+ var data = response.data,
580
+ promise = value.$promise;
581
+
582
+ if (data) {
583
+ // Need to convert action.isArray to boolean in case it is undefined
584
+ // jshint -W018
585
+ if (angular.isArray(data) !== (!!action.isArray)) {
586
+ throw $resourceMinErr('badcfg',
587
+ 'Error in resource configuration for action `{0}`. Expected response to ' +
588
+ 'contain an {1} but got an {2}', name, action.isArray ? 'array' : 'object',
589
+ angular.isArray(data) ? 'array' : 'object');
590
+ }
591
+ // jshint +W018
592
+ if (action.isArray) {
593
+ value.length = 0;
594
+ forEach(data, function (item) {
595
+ if (typeof item === "object") {
596
+ value.push(new Resource(item));
597
+ } else {
598
+ // Valid JSON values may be string literals, and these should not be converted
599
+ // into objects. These items will not have access to the Resource prototype
600
+ // methods, but unfortunately there
601
+ value.push(item);
602
+ }
603
+ });
604
+ } else {
605
+ shallowClearAndCopy(data, value);
606
+ value.$promise = promise;
607
+ }
568
608
  }
569
- }
570
609
 
571
- value.$resolved = true;
610
+ value.$resolved = true;
572
611
 
573
- response.resource = value;
612
+ response.resource = value;
574
613
 
575
- return response;
576
- }, function(response) {
577
- value.$resolved = true;
614
+ return response;
615
+ }, function (response) {
616
+ value.$resolved = true;
578
617
 
579
- (error||noop)(response);
618
+ (error || noop)(response);
580
619
 
581
- return $q.reject(response);
582
- });
620
+ return $q.reject(response);
621
+ });
583
622
 
584
- promise = promise.then(
585
- function(response) {
623
+ promise = promise.then(
624
+ function (response) {
586
625
  var value = responseInterceptor(response);
587
- (success||noop)(value, response.headers);
626
+ (success || noop)(value, response.headers);
588
627
  return value;
589
628
  },
590
629
  responseErrorInterceptor);
591
630
 
592
- if (!isInstanceCall) {
593
- // we are creating instance / collection
594
- // - set the initial promise
595
- // - return the instance / collection
596
- value.$promise = promise;
597
- value.$resolved = false;
631
+ if (!isInstanceCall) {
632
+ // we are creating instance / collection
633
+ // - set the initial promise
634
+ // - return the instance / collection
635
+ value.$promise = promise;
636
+ value.$resolved = false;
598
637
 
599
- return value;
600
- }
638
+ return value;
639
+ }
601
640
 
602
- // instance call
603
- return promise;
604
- };
641
+ // instance call
642
+ return promise;
643
+ };
605
644
 
606
645
 
607
- Resource.prototype['$' + name] = function(params, success, error) {
608
- if (isFunction(params)) {
609
- error = success; success = params; params = {};
610
- }
611
- var result = Resource[name].call(this, params, this, success, error);
612
- return result.$promise || result;
613
- };
614
- });
646
+ Resource.prototype['$' + name] = function (params, success, error) {
647
+ if (isFunction(params)) {
648
+ error = success; success = params; params = {};
649
+ }
650
+ var result = Resource[name].call(this, params, this, success, error);
651
+ return result.$promise || result;
652
+ };
653
+ });
615
654
 
616
- Resource.bind = function(additionalParamDefaults){
617
- return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);
618
- };
655
+ Resource.bind = function (additionalParamDefaults) {
656
+ return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);
657
+ };
619
658
 
620
- return Resource;
621
- }
659
+ return Resource;
660
+ }
622
661
 
623
- return resourceFactory;
624
- }]);
662
+ return resourceFactory;
663
+ }];
664
+ });
625
665
 
626
666
 
627
667
  })(window, window.angular);