集合方法
- getList([queryParams, headers]): Gets itself again (Remember this is a collection).
- get([id]): Gets one item from the collection by id.
- post(elementToPost, [queryParams, headers]): Creates a new element of this collection.
- head([queryParams, headers]): Does a HEAD
- trace: ([queryParams, headers]): Does a TRACE
- options: ([queryParams, headers]): Does a OPTIONS
- patch(object, [queryParams, headers]): Does a PATCH
- remove([queryParams, headers]): Does a DELETE. By default,
remove
sends a request with an empty object, which may cause problems with some servers or browsers. This shows how to configure RESTangular to have no payload.
- putElement(idx, params, headers): Puts the element on the required index and returns a promise of the updated new array
- getRestangularUrl(): Gets the URL of the current object.
- getRequestedUrl(): Gets the real URL the current object was requested with (incl. GET parameters). Will equal getRestangularUrl() when no parameters were used, before calling
getList()
, or when using on a nested child.
- one(route, id): Used for RequestLess connections and URL Building. See section below.
- all(route): Used for RequestLess connections and URL Building. See section below.
- several(route, ids*): Used for RequestLess connections and URL Building. See section below.
- oneUrl(route, url): This will create a new Restangular object that is just a pointer to one element with the specified URL.
- allUrl(route, url): This creates a Restangular object that is just a pointer to a list at the specified URL.
- clone(): Copies the collection. It's an alias to calling
Restangular.copy(collection)
.
- withHttpConfig(httpConfig): It lets you set a configuration for $http only for the next call. Check the Local Config HTTP section for an example.