aboutsummaryrefslogtreecommitdiffstats
path: root/src/ngResource/resource.js
AgeCommit message (Collapse)Author
2013-02-27feat($resource): ability to override url in resource actionszeflasher
Resources now can defined per action url override. The url is treated as a template rather than a literal string, so fancy interpolations are possible. See attached tests for example usage.
2013-02-26fix($http): don't encode URL query substring "null" to "+"Andrew McLeod
Fixes issue in encodeUriQuery used by $http and $resource that treats null as a string and replaces the characters "null" with "+".
2013-02-14docs($resource): fix bad indentation producing a code blockCedric Soulas
2013-02-14fix($resource): params should expand array values properlyMark Nadig
Today, calling e.g. var R = $resource('/Path/:a'); R.get({a: 'foo', bar: ['baz1', 'baz2']}); results in a query string like "/Path/doh?bar=baz1,baz2" which is undesirable. This commit enhances resource to use $http to encode any non-url parameters resulting in a query string like "/Path/doh?bar=baz1&bar=baz2". BREAKING CHANGE: if the server relied on the buggy behavior then either the backend should be fixed or a simple serialization of the array should be done on the client before calling the resource service.
2013-02-14fix(resource): Update RegExp to allow urlParams with out leading slashFredrik Bonander
Will allow reoucese to be loaded from a relative path Example: var R = $resource(':path'); R.get({ path : 'data.json' }); Example usage: Load resources in applications not using webserver, ie local webapp in on a tablet.
2013-02-14docs($resource): fix missing punctuationCedric Soulas
2013-02-11feat($resource): expose promise based api via $then and $resolvedIgor Minar
Expose $then and $resolved properties on resource action return values which allow checking if a promise has been resolved already as well as registering listeners at any time of the resource object life-cycle. This commit replaces unreleased commit f3bff27460afb3be208a05959d5b84233d34b7eb which exposed unintuitive $q api instead and didn't expose important stuff like http headers.
2013-01-23feat(resource): add $q/$resorved property to ResourcePartap Davis
2013-01-22revert: fix($resource): Route constructor, updated RegExpIgor Minar
This reverts commit 06ed8ef0127bf80610eba17b5021d1f483d0b0bf. The reverted commit causes regressions. See comments in the PR: https://github.com/angular/angular.js/pull/1402#issuecomment-12575399
2013-01-18fix($resource): Route constructor, updated RegExpFredrik Bonander
Update RegExp to allow urlParams with out leading slash (/). - Will allow reoucese to be loaded from a relative path Example: var R = $resource(':path'); R.get({ path : 'data.json' }); Example usage: Load resources in applications not using webserver, ie local webapp in on a tablet.
2013-01-18fix(ngResource): correct leading slash removal.pavelgj
Fixed an issues with ngResource param substitution where it was incorrectly removing leading slash when param was followed by a non-slash character. Ex: '/:foo/:bar.baz/:aux' params = { foo: 'aaa', bar: undefined, aux: undefined } The above params were incorrectly producing '/aaa.baz' but now it results in '/aaa/.baz'.
2013-01-17feat(ngResource): support all $http.config actionsMisko Hevery
This allows the transformation of the $http request in both directions, headers, caching, and timeout.
2012-12-09docs($resource): document port number escaping and fix typoJuha Syrjälä
Closes #1243
2012-11-30fix($resource): HTTP method should be case-insensitiveSudhir Jonathan
Perform call `angular.uppercase` on all given action methods. Closes #1403
2012-11-30refactor($resource): fix indentation and move a method definitionCezar Berea
Moved Resource.bind out of the actions forEach
2012-11-28feat($resource): allow dynamic default parametersPascal Corpet
Default resource params can now be calculated at runtime if defined via a function.
2012-11-24fix($resource): prevent default params to be shared between actionsAdrian Gheorghe
Having a $resource defined as: var R = $resource('/Path', {}, { get: {method: 'GET', params: {objId: '1'}}, perform: {method: 'GET'} }); was causing both actions to call the same URI (if called in this order): R.get({}); // => /Path?objId=1 R.perform({}); // => /Path?objId=1
2012-09-11docs(ngResource): Spelling typo (agressive => aggressive)Jay Zeng
2012-09-10fix($resource): fix isDefined -> angular.isDefinedIgor Minar
2012-09-06fix($resource): allow falsy values in URL parametersBenjamín Eidelman
Close #1212 when a param value was 0 (or false) it was ignored and removed from url. after this fix that only happens if the value is undefined or null.
2012-09-06fix($resource): ignore undefined parameterspetrovalex
- $resource should handle multiple params with same name - ignore slashes of undefined parameters - fix default parameters issue, mentioned in #875 Closes #875 Closes #782
2012-09-06feat($resource): support custom headers per actionMax Martinsson
Closes #736
2012-06-12docs(*): simplify doc urlsIgor Minar
we now have two types of namespaces: - true namespace: angular.* - used for all global apis - virtual namespace: ng.*, ngMock.*, ... - used for all DI modules the virual namespaces have services under the second namespace level (e.g. ng.) and filters and directives prefixed with filter: and directive: respectively (e.g. ng.filter:orderBy, ng.directive:ngRepeat) this simplifies urls and makes them a lot shorter while still avoiding name collisions
2012-04-20feat($resource): support HTTP PATCH methodsimpulton
Properly serialize data into request body instead of url. Closes #887
2012-04-15docs($resource): fix the exampleVojta Jina
2012-03-28chore(resource): moved to moduleMisko Hevery
2012-03-28chore(Rakefile): get ready for modulesMisko Hevery