StrongLoop Loopback Yeoman Angular

I am trying to integrate Loopback StrongLoop [backend] with the Yeoman [frontend] workflow, but struggling to merge the two code files. I know that I can independently develop my backend using Loopback StrongLoop and just expose it as a REST API. However, I would prefer to develop using the Loopback Angular SDK and connect to the models programmatically in one application. I am wondering how I need to organize the folder structure, update my Gruntfile.js to enable the Loopback application setup for maintenance and build functions, and only start one instance of the server for development (instead of "grunt serve" for my myoman appendend and "slc run applications "for backend loop).

I read about β€œplans” for yoman scaffolding as opposed to the CLI workflow for Loopback, but they do not contain any changes for 5 months + on Github.

Any guidance is appreciated to get it working now (as opposed to waiting for this feature).

For reference: Here are the Loopback Angular SDK instructions with detailed Grunt commands http://docs.strongloop.com/display/DOC/AngularJS+JavaScript+SDK

+6
source share
1 answer

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

+5
source

All Articles