February 2015
Intermediate to advanced
232 pages
4h 40m
English
We are going to define some services to define CRUD operations for our products and orders. A common mistake that some developers make is setting CRUD operations within model classes. Best practice says that it is better to separate models and communication layers.
To prepare your project, create a folder called services. In this folder, store files that will contain CRUD operations. Perform the following steps:
OrderResource.js and ProductResource.js.ProductResource.js file and define basic CRUD operations as follows:var ProductResource = (function () { function all() {} function get(id) {} function create(product) {} ...Read now
Unlock full access