Confusion with getList documentation
SandipNirmal opened this issue · 0 comments
SandipNirmal commented
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.