Commit graph

37 commits

Author SHA1 Message Date
Igor Minar
44b2f44f93 fix($resource): forwardport exposing headers from 0.9.19 2011-12-01 16:20:08 -05:00
Igor Minar
dbd880cc0a feat($http): add promise support
quite messy, some tests are missing, contains an experimental jasmine DI support)
2011-11-30 14:49:35 -05:00
Vojta Jina
feacf608ee fix($resource): to work with $http, $httpBackend services
Breaks Disabling $resource caching for the moment.
2011-11-30 11:17:22 -05:00
Misko Hevery
fd822bdaf9 chore(formating): clean code to be function() { 2011-10-11 11:01:46 -07:00
Marcello Nuccio
bf5e5f7bc9 fix($resource): action defaults should override resource defaults
defaults definned per action should take precedence over defaults
defined for the whole resource.

This is potentialy a BREAKING CHANGE in case someone relied on the buggy
behavior.
2011-09-27 00:44:10 +02:00
Karl Seamon
6114c8f504 fix($resource): properly call error callback when resource is called with two arguments 2011-08-18 15:07:04 -04:00
Karl Seamon
b5594a773a feat($xhr): add custom error callback to $xhr, $xhr.cache, $xhr.bulk, $resource
Closes #408
2011-07-27 15:21:31 -07:00
Igor Minar
fe5240732d feat(strict mode): adding strict mode flag to all js files
the flag must be in all src and test files so that we get the benefit of
running in the strict mode even in jstd

the following script was used to modify all files:

for file in `find src test -name "*.js"`; do
  echo -e "'use strict';\n" > temp.txt
  cat $file >> temp.txt
  mv temp.txt $file
done
2011-07-18 12:12:55 -07:00
Igor Minar
754d2541c4 correct $resource's success callback execution
succcess callbacks should be executed for status codes in the range
of <200,300).
2011-04-04 16:04:37 -07:00
Igor Minar
78a0f41058 encode query params correctly but not too agressively 2011-03-31 21:45:28 -07:00
Anthony Lieuallen
94514a91f8 Don't mutate resource if server responded with no body
If the server provides response with no body to a resource request,
resource should not mutate the resource model in the callback.
2011-03-29 00:25:22 -07:00
Igor Minar
e1d122a4b7 encode $resource query params using encodeURIComponent 2011-03-28 23:33:46 -07:00
Vojta Jina
9312bed472 Added missing semi-colons
So that my eclipse stops complaining...
2011-03-28 23:04:48 -07:00
Igor Minar
1e59822df7 remove _null and _undefined
they have no significant effect on minified and gziped size. in fact
they make things worse.

file        | before     | after removal
----------------------------------------
concat      | 325415     | 325297
min         | 62070      | 62161
min + gzip  | 25187      | 25176

The bottom line is that we are getting 0.05% decrease in size after
gzip without all of the hassle of using underscores everywhere.
2011-03-26 23:19:04 -07:00
Igor Minar
9e30baad3f resources should not over-encode chars in url path
- added encodeUriSegment that properly encodes only those chars
  that URI RFC requires us to encode
- modified Resource to use encodeUriSegment
2011-02-17 23:06:53 -08:00
Igor Minar
e9ce22592a $resource should encode url params with encodeURIComponent 2011-02-10 17:57:42 -08:00
Igor Minar
9ccd2f0412 adding a fallthrough comment 2011-01-11 17:48:30 -08:00
Igor Minar
0a6cf70deb Rename angular.foreach to angular.forEach to make the api consistent.
camelcase is used for other angular functions and forEach is also
used by EcmaScript standard.

- rename the internal as well as the external function name
- tweak the implementation of the function so that it doesn't
  clober it self when we extend the angular object with an
  object that has a forEach property equal to this forEach function

Closes #85
2011-01-10 10:26:55 -08:00
Misko Hevery
a36964799b fixed lint warnings and one flaky test 2010-10-15 13:44:53 -07:00
Alkis Evlogimenos
eefb920d0e Reduce copies done by Resource.
When a method foo is called on a Resource object, say myResource there are two copies that happen to the resource:
	- one inside Resource.foo() in some dummy function
	- another inside myResource.$foo() inside the callback passed to foo()
2010-09-22 09:14:50 +02:00
Alkis Evlogimenos
293f34cd64 Expose GET operations on resources as well. This allows us to read
"partials". The pattern is demostrated in the unittest:

Resource.query returns a list of "keys" to resources, which are
partially defined. They have enough data to allow $get to fetch the
whole gamout. Then $get fetches all the details of the resource.
2010-09-16 00:23:22 +02:00
Misko Hevery
21e78c443f Delete requests on resources pass this as data. Delete requests should not be passing data in the body of the response. The bug is here:
http://github.com/angular/angular.js/blob/master/src/Resource.js#L119

Instead of checking for !isGet you should be checking for !isPost. Also isPost should be isPostOrPut since only on those two methods should be sending a payload if I am not mistaken.
2010-09-16 00:20:35 +02:00
Misko Hevery
5ddd8d9586 stringify names for better compression, remove dead functions, removed underscore.js compatibility 2010-08-18 17:26:33 -07:00
Misko Hevery
849a05b5a5 added jsonp to resources 2010-07-22 11:18:32 -07:00
Rob Spies
4034a2d1e2 better naming for our verify cache scheme, and tests. 2010-07-13 14:09:53 -07:00
Rob Spies
1500e91def Merge http://github.com/angular/angular.js into angular
Conflicts:
	.gitignore
2010-06-22 17:09:55 -07:00
Misko Hevery
0f73084e9d added error handler to xhr requests 2010-05-19 11:51:17 -07:00
Misko Hevery
038a743e6f xhr bulk fixes 2010-05-07 12:09:14 -07:00
Misko Hevery
fce48eb60a resources now use browser mock 2010-04-27 11:18:08 -07:00
Misko Hevery
a80a61839a injection is now working 2010-04-03 17:04:36 -07:00
Misko Hevery
e55c97deba dissabled a lot of tests, and made the core test set pass. 2010-03-29 20:25:42 -07:00
Misko Hevery
7634a3ed52 initial revision of new plugable compiler 2010-03-18 12:20:06 -07:00
Adam Abrons
c9aba8b442 make xhr just a method 2010-03-16 14:48:11 -07:00
Adam Abrons
2df072e3f8 twitter using resources 2010-03-16 14:38:56 -07:00
Adam Abrons
79b743e52f resources, with bind() 2010-03-15 15:57:12 -07:00
Adam Abrons
f9f181a33e copy response into resource on save. update jstestdriver 2010-03-15 15:02:52 -07:00
Misko Hevery
cc71b745c3 added resources; removed compiled code 2010-03-15 14:36:50 -07:00