There is a local $ resource to interact with the RESTful server.
Textbook
You can also use the custom build service to combine the loopback API and Angular front end:
angular.module('catalog', []) .constant('ENDPOINT_URI', 'http://0.0.0.0:3000/api/') .controller('CatalogController', function (ProductsModel) { var store = this; function getItems() { ProductsModel.all() .then(function (result) { store.products = result.data; }); } store.products = []; getItems(); }) .service('ProductsModel', function ($http, ENDPOINT_URI) { var service = this, path = 'products/'; function getUrl() { return ENDPOINT_URI + path; } service.all = function () { return $http.get(getUrl()); }; });
Textbook
source share