mgonto / restangular

AngularJS service to handle Rest API Restful Resources properly and easily
MIT License
7.87k stars 840 forks source link

Confusion with getList documentation #1465

Open SandipNirmal opened 7 years ago

SandipNirmal commented 7 years ago

I was going through the ReadMe and I found

getList(subElement, [queryParams, headers]): Gets a nested resource. subElement is mandatory. It's a string with the name of the nested resource (and URL). For example buildings

But you mentioned something else in issue-450

getList can be called both ways. If it's called in an element one, then it needs a subelement to get to a Collection. Otherwise, it fetches the collection. So the following is the same:

Restangular.one('places', 123).getList('venues')
Restangular.one('places', 123).all('venues').getList()

In actual use, subElement is not manadatory in getList() method.