"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);
This commit is contained in:
Marvin Luchs
2015-04-27 13:01:12 +02:00
parent 00e7f3fede
commit cc0537a0ac

View File

@@ -93,7 +93,7 @@ declare module restangular {
withConfig(configurer: (RestangularProvider: IProvider) => any): IService;
restangularizeElement(parent: any, element: any, route: string, collection?: any, reqParams?: any): IElement;
restangularizeCollection(parent: any, element: any, route: string): ICollection;
service(route: string, parent: any): IService;
service(route: string, parent?: any): IService;
stripRestangular(element: any): any;
}