Commit graph

38 commits

Author SHA1 Message Date
Marcello Nuccio
b3ed7a8a7a 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:52:12 +02:00
Karl Seamon
4ec1d8ee86 feat($xhr,$resource): expose response headers in callbacks
all $xhr*, $resource and related mocks now have access to headers from
their callbacks
2011-08-19 01:20:45 -07:00
Karl Seamon
c37bfde9eb fix($resource): properly call error callback when resource is called with two arguments 2011-08-19 01:17:20 -07: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
Vojta Jina
2e5199997c Rename deprecated wasCalled() -> toHaveBeenCalled() in all specs
As well as wasNotCalled(), wasCalledWith(), wasNotCalledWith()
2011-05-31 10:32:54 +02: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
Igor Minar
9985104dc0 remove weird spaces from resource mutation test 2011-03-30 15:22:14 -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
945056b166 linking function should return bound scope
angular.compile()() returns {scope:scope, view:view},
this isn't useful at all and only makes tests more verbose.
Instead, this change makes the linking function return scope directly
and if anyone needs the linked dom there are two ways to do it
documented in angular.compile.

other changes:
- moved angular.compile docs to the compiler so that they are closer to
  the compiler
- fixed some typos and updated angular.compile docs with the new return
  value
2011-03-01 17:09:25 -08: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
Misko Hevery
ef4bb28be1 Change API angular.compile(element)([scope], [element/true]) 2011-02-16 01:03:12 -05:00
Igor Minar
e9ce22592a $resource should encode url params with encodeURIComponent 2011-02-10 17:57:42 -08:00
Igor Minar
b2631f6170 rename scope.$inject to scope.$service
see changelog diff for more info
2011-01-04 18:04:00 -08:00
Igor Minar
5a534235b6 fixing invalid json strings in ResourceSpec 2010-12-23 09:03:34 -08:00
Igor Minar
011fa39c2a add $browser.defer and $defer service and fix async xhr cache issue
- Closes #152 ($resource().query() sometimes calls callback before
  returning, and it shouldn't)
- add $browser.defer method
- add $defer service
- integrate $browser.defer with outstandingRequests counter in $browser
- fix all old tests that relied on buggy behavior
2010-12-06 16:45:59 -08:00
Misko Hevery
5a8ad8fe32 Closes #170. Corrected the behavior of select when options are ng:repeated
- Delete $postEval method, as it was a hack
2010-12-02 22:45:57 -08:00
Misko Hevery
d9abfe8a7e Introduced injector and $new to scope, and injection into link methods and controllers
- added angular.injector(scope, services, instanceCache) which returns inject
    - inject method can return, instance, or call function which have $inject
      property
    - initialize services with $creation=[eager|eager-publish] this means that
      only some of the services are now globally accessible
  - upgraded $become on scope to use injector hence respect the $inject property
    for injection
    - $become should not be run multiple times and will most likely be removed
      in future version
  - added $new on scope to create a child scope
     - $inject is respected on constructor function
  - simplified scopes so that they no longer have separate __proto__ for
    parent, api, behavior and instance this should speed up execution since
    scope will now create one __proto__ chain per scope (not three).

BACKWARD COMPATIBILITY WARNING:
  - services now need to have $inject instead of inject property for proper
    injection this breaks backward compatibility
  - not all services are now published into root scope
    (only: $location, $cookie, $window)
  - if you have widget/directive which uses services on scope
    (such as this.$xhr), you will now have to inject that service in
    (as it is not published on the root scope anymore)
2010-10-12 16:33:06 -07: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
5ddd8d9586 stringify names for better compression, remove dead functions, removed underscore.js compatibility 2010-08-18 17:26:33 -07:00
Misko Hevery
4aac29da18 added additional test 2010-08-10 11:17:08 -07:00
Misko Hevery
849a05b5a5 added jsonp to resources 2010-07-22 11:18:32 -07:00
Rob Spies
ac3c2736c7 Removes silly test addition. 2010-07-13 14:15:01 -07:00
Rob Spies
4034a2d1e2 better naming for our verify cache scheme, and tests. 2010-07-13 14:09:53 -07:00
Rob Spies
8f9bf37bcf asdsad 2010-06-22 17:11:57 -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
c7913a4b7a added $xhr service with bulk and cache, hooked up $resource 2010-04-29 17:28:33 -07:00
Misko Hevery
913729ee01 fix isssue where the jasmine currentSpec does not get updated and hence everything runs as last spec context. 2010-04-29 10:55:22 -07:00
Misko Hevery
fce48eb60a resources now use browser mock 2010-04-27 11:18:08 -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
Adam Abrons
c9aba8b442 make xhr just a method 2010-03-16 14:48:11 -07:00
Adam Abrons
79b743e52f resources, with bind() 2010-03-15 15:57:12 -07:00
Misko Hevery
cc71b745c3 added resources; removed compiled code 2010-03-15 14:36:50 -07:00