Skip to content

Confusion with getList documentation #1465

Open

Description

@SandipNirmal

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions