February 2015
Intermediate to advanced
232 pages
4h 40m
English
In terms of code, building a module that contains a model and building one that contains a resource is not so different. The module pattern applied is the same. Nevertheless, you don't need to create instances of the resources. To apply CRUD operations to the models, you just need an object that handles this responsibility. Therefore, the resources will be singletons, as done in the following steps:
resources/ProductResource.js file.var Shop;
Shop = Shop || {};Resources namespace:Shop.Resources = Shop.Resources || {};ProductResource using the module pattern:Shop.Resources.ProductResource = (function(){
})()Read now
Unlock full access