Skip to content

Restangularize subresources #747

@gabzim

Description

@gabzim

Is there a simple way to tell restangular that a certain field is a collection of resources?

For instance in my app I can do:

GET to: /api/courses/123
Restangular.one('courses', 123).get();

/* OR */

GET to: /api/courses/123/students
Restangular.one('courses', 123).all('students').getList();

The first call however, fetches the course with a field students that already contains an array of the students in the course. Is there any way to say: "Restangular, this array is not merely an array of objects, but rather it's a student collection" so that then I can do things like students[0].remove()

Unrelated: Vamos a ganar el mundial o no?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions