bower install restangularÂ
angular.module('your-app', ['restangular']);
var planets = restangular.all('planets'); planets.getList();
planets.getRestangularUrl();
"/planets" planets.getList().then(function(data){...});id: "moon"
....
one: function () {
oneUrl: function () {
options: function () {
parentResource: Object
patch: function () {
plain: function () {
post: function () {
put: function () {
...MANY MORE moon.plain();var earth;
planets.getList().then(function(data) { earth = data[2]; });
//or get it directly
planets.one('Earth’).doGET();
earth.get();
planets.one('Earth').get();
earth.getRestangularUrl();
earth.getList('moons');
var moon;
earth.getList('moons').then(function(data) { moon = data[0]; });
moon.getRestangularUrl()
"/planets/Earth/moons/Moon"var newMoon = restangular.copy(moon);
newMoon.id = 'NewMoon';
newMoon.save();
newMoon.remove();