Commit Graph
55 Commits
Author SHA1 Message Date
AndyandGitHub 8e571d7b13 Merge pull request #11230 from ngraef/patch-2
[restangular]: add route-bound methods for scoped service
2016-09-21 10:43:30 -07:00
Nick GraefandMasahiro Wakame 50155318b2 fix function signatures (#11261)
Documentation: https://github.com/mgonto/restangular#restangular-methods

According to the documentation and source code, `all` and `allUrl` return collections, not elements.
Additionally, the `post` signature without `subElement` is only available on collections, not elements.
2016-09-19 15:16:16 +09:00
Nick GraefandGitHub 27347de728 add route-bound methods for scoped service
Documentation: https://github.com/mgonto/restangular#decoupled-restangular-service

When configured via `Restangular.service('route')`, the route is bound to some functions. This change overrides those functions with the correct signatures.
2016-09-14 14:13:28 -05:00
Mohamed HegazyandGitHub 81ea588f58 Merge pull request #8380 from seonetartem/patch-1
Update restangular.d.ts
2016-06-26 16:17:43 -07:00
Brendon ColburnandMasahiro Wakame 1f8e49ff30 Add some properties to Restangularized Elements (#9240)
When an element is restangularized it often has one to many of the properties added in this proposed code change.  Leveraging the route, id, and reqParams gives greater functionality to restangularized objects in typescript projects.
2016-05-14 23:26:58 +09:00
Péter BabcsányandMasahiro Wakame 47363c7222 Update restangular.IProvider.setErrorInterceptor method signature to be compatible with Restangular 1.5 (#9032) 2016-04-23 15:22:08 +09:00
vvakame 7de6c3dd94 Merge branch 'master' into rename-repo-url 2016-03-17 21:06:54 +09:00
vvakame 14fe4313f4 replace internal module to namespace 2016-03-17 02:18:10 +09:00
vvakame 56295f5058 replace https://github.com/borisyankov/DefinitelyTyped to https://github.com/DefinitelyTyped/DefinitelyTyped 2016-03-17 00:55:26 +09:00
artem 90ecfb5cab Update restangular.d.ts 2016-03-04 12:10:52 +02:00
Tadeusz Hucal f2ae460e17 Update module name from ng to angular 2015-11-13 19:24:04 +01:00
Tadeusz Hucal 158f0715ab Restangular: restore synchronization with Angular's request configuration 2015-10-03 18:58:28 +02:00
Lukas Sembera f38b15bc38 Add missing headers() function to restangular's IResponse 2015-09-20 19:46:51 +02:00
Adam Martin 3c79b26f0b Allow for ES6 Import of Restangular 2015-08-21 12:13:17 +01:00
Sebastian Clausen 1bd72e00bf Restangular: ICollection extends Array to inherit splice and indexOf 2015-08-03 11:31:47 +02:00
Matthew Hill 7488c8df11 extends restangular IProvider in IService interface 2015-06-29 23:21:37 +01:00
Max Nylin 16744e323f Added definition of extendModel() in IService for Restangular 2015-05-12 11:45:48 +02:00
Marvin Luchs a013599373 Added missing plain() and clone() methods to Restangular's IElement and ICollection
restangularizeCollection() [1] and restangularizeElem() [2] are used to
create objects that implement IElement and ICollection respectively.
Both use restangularizeBase() [3] which adds the clone() and plane()
methods.

Therefore both IElement and ICollection should both implement clone()
and plain(). Additionally I added a generic variant of the already
existing plain() method in IElement to both IElement and ICollection.

[1]
https://github.com/mgonto/restangular/blob/master/src/restangular.js#L982
[2]
https://github.com/mgonto/restangular/blob/master/src/restangular.js#L951
[3]
https://github.com/mgonto/restangular/blob/master/src/restangular.js#L764
2015-04-29 13:38:43 +02:00
Marvin Luchs b9e995eb9b ICollectionPromise<T> should extend ng.IPromise with an array of T
ICollectionPromise<T> extends ng.IPromise<T> is the equivalent of
interface IPromise<T> extends ng.IPromise<T> for arrays of T. Therefore
it makes no sense to extend ng.IPromise with just T. Instead it has to
be an array of T.

The consequence of this bug can be observed when calling

Restangular.all('someEntity').getList<SomeEntity>().then((entities) =>
{...})

In this case the TypeScript compiler handles entities as SomeEntity, not
SomeEntity[].
2015-04-29 10:09:09 +02:00
Marvin Luchs cc0537a0ac "parent" argument of Restangular.service() should be optional
The documentation as well as the actual source code of Restangular
define the parent argument of Restangular.service(route, parent) as
optional:

https://github.com/mgonto/restangular#decoupled-restangular-service

function toService(route, parent) {
[...]
var collection = (parent || service).all(route);
2015-04-27 13:01:12 +02:00
Masahiro Wakame 334f1ac57f Merge pull request #3977 from samherrmann/add-missing-restangular-methods
Add missing plain and clone method to restangular IElement
2015-03-29 22:51:55 +09:00
Sam Herrmann 300d87447e Add missing plain and clone method to restangular IElement
See https://github.com/mgonto/restangular#element-methods for documentation on the methods.
2015-03-26 22:41:54 -04:00
Dominik Münch f5855b4d5b restangular: Add missing save method 2015-03-26 14:37:10 +01:00
vvakame 070fd9d268 remove not required tscparams 2015-01-02 20:48:15 +09:00
Mohamed Hegazy 2aaa293cb1 Remove quotes from response files 2014-09-02 14:53:39 -07:00
Jon Stelly a32e2bc731 Restangular: fix test compilation 2014-08-26 08:33:27 -05:00
Jon Stelly b57a5b1072 Restangular: add generic overloads for get<T>(), getAll<T>() and post<T>() 2014-08-26 08:23:55 -05:00
jonathantyates aa05ededee Update restangular.d.ts
Added service method from https://github.com/mgonto/restangular#decoupled-restangular-service
2014-08-23 00:42:29 -04:00
Keats 114f930fbd Update Restangular definition
Add enhanced promises
Add new methods up to current 1.4
Rewrite tests to make them more realistic
2014-04-27 10:19:26 +01:00
Santi Albo e3d8e5fe91 fix restangular test 2014-04-24 11:42:09 +01:00
Santi Albo e3c20e7aca (restangular) Fix argument order in custom methods
The arguments were in the wrong order for custom methods
2014-04-24 11:35:12 +01:00
vvakame 5a37274782 remove not required .tscparams 2014-03-15 19:00:36 +09:00
Gabriele Genta 99468aa382 Made every type declaration explicit to prevent compilation errors when using the --noImplicitAny switch. 2014-02-24 16:24:46 +01:00
Santi Albo 43004ba4ef Define own all-optional IRequestConfig 2014-01-28 17:17:01 +00:00
Santi Albo 8d7e7127d7 Add a test 2014-01-28 17:15:15 +00:00
Santi Albo aa19aca412 (restangular) Add some missing methods
Adds
- `oneUrl`
- `allUrl`
- `withHttpConfig`
2014-01-28 17:05:09 +00:00
mick delaney eaf4ce0ed4 Restangular: Adding In Some Restangular Api Methods 2014-01-10 12:47:05 +00:00
vvakame 2708bc05cd Fixed tsc failed on Node.js v0.8.25 2013-10-03 11:23:38 +09:00
vvakame 3fe1f6bc4e Fixed to CI test passing 2013-10-03 10:18:58 +09:00
Santi Albo 59b2a24150 Add previous tests 2013-09-03 23:08:47 +01:00
Santi Albo ee99d701b5 Add tests for setErrorInterceptor 2013-09-03 17:24:42 +01:00
Santi Albo f9ff1d914a Fix Response type 2013-09-03 17:05:42 +01:00
Santi Albo 835f1c84d8 Add typing for response objects 2013-09-03 10:22:16 +01:00
Santi Albo d95465e400 "setListTypeIsArray" is deprecated 2013-09-03 09:41:56 +01:00
Santi Albo 6cdeeeb2b2 Better type signatures for RestangularProvider methods 2013-09-03 09:41:21 +01:00
Santi Albo 51181ea711 "users" is a RestangularCollection, one -> `all 2013-08-21 10:51:25 +01:00
Santi Albo c4ce9e9723 Remove unnecessary definitions and other small fixes
- Use optional parameters to delete unnecessary definitions.
- `queryParams` type is `any`, not `string`.
- Delete `getList` type definition without any arguments for `RestangularElement` since the documentation says that `subElement` is mandatory (https://github.com/mgonto/restangular#element-methods)
2013-08-18 21:05:49 +01:00
Santi Albo fbfbc7ca5e Fix type signatures for methods that return an IPromise 2013-08-13 22:23:59 +01:00
Boris Yankov dd35f69637 Big replacement: bool with boolean 2013-08-07 16:59:39 +03:00
Diullei Gomes 17df2c7aaa Merge pull request #815 from santialbo/patch-3
Restangular also accepts strings as id for the method "one"
2013-08-03 09:06:42 -07:00