UNPKG

lazo-next

Version:

A client-server web framework built on Node.js that allows front-end developers to easily create a 100% SEO compliant, component MVC structured web application with an optimized first page load.

22 lines (20 loc) 783 B
define(['lazoModel', 'lazoCollection', 'resolver/main'], function (LazoModel, LazoCollection, resolver) { 'use strict'; var modelLoader = function (name, type, cb) { resolver.isBase(('models/' + name + '/' + type), 'model', function (isBase) { if (isBase) { cb(type === 'model' ? LazoModel : LazoCollection, true); } else { LAZO.require(['models/' + name + '/' + type], function (model) { // https://github.com/jrburke/requirejs/issues/922 if (typeof model === 'function') { cb(model); } } ); } }); }; return modelLoader; });