diff --git a/@salix/app/src/app.js b/@salix/app/src/app.js index a4cf9ee7c..6f2c434cc 100644 --- a/@salix/app/src/app.js +++ b/@salix/app/src/app.js @@ -1,3 +1,6 @@ import {bootstrap} from './bootstrap'; -import * as spliting from './spliting' +import * as spliting from './spliting'; +import * as routes from './routes'; + + bootstrap(); diff --git a/@salix/app/src/bootstrap.js b/@salix/app/src/bootstrap.js index cb1dcaf4a..0c9980703 100644 --- a/@salix/app/src/bootstrap.js +++ b/@salix/app/src/bootstrap.js @@ -13,5 +13,5 @@ export const bootstrap = () => { if (!_element) { throw new Error("element is not defined"); } - ng.bootstrap(_element, [NAME]); + ng.bootstrap(_element, [NAME]); }; \ No newline at end of file diff --git a/@salix/app/src/package.json b/@salix/app/src/package.json new file mode 100644 index 000000000..626726422 --- /dev/null +++ b/@salix/app/src/package.json @@ -0,0 +1,10 @@ +{ + "name": "@salix/core", + "version": "0.0.0", + "description": "", + "main": "index.js", + "repository": { + "type": "git", + "url": "http://git.verdnatura.es:/salix" + } +} diff --git a/@salix/app/src/routes.js b/@salix/app/src/routes.js new file mode 100644 index 000000000..444663d47 --- /dev/null +++ b/@salix/app/src/routes.js @@ -0,0 +1,24 @@ +import * as core from '@salix/core'; +import * as spliting from './spliting'; + + +core.module.config(function($stateProvider, $urlRouterProvider) { + + $urlRouterProvider.otherwise("/"); + + $stateProvider + .state('index', { + url: "/index", + component:'customer.add', + templateProvider: function(){ + console.log("hello"); + }, + resolve: { + loader: function($ocLazyLoad, $q){ + return $q((resolve) => { + spliting.crud($ocLazyLoad, resolve); + }); + } + } + }) +}); diff --git a/@salix/app/src/spliting.js b/@salix/app/src/spliting.js index a672cea56..052620631 100644 --- a/@salix/app/src/spliting.js +++ b/@salix/app/src/spliting.js @@ -1,19 +1,20 @@ -const crud = () => { +export const crud = (lazy, resolve) => { require.ensure([], () => { - require('@salix/crud') + var module = require('@salix/crud'); + resolve(lazy.load({name:'crud'})); }, "salix.crud"); }; -const compras = () => { +export const compras = () => { require.ensure([], () => { require('@salix/compras') }, "salix.compras"); }; -const ventas = () => { +export const ventas = () => { require.ensure([], () => { require('@salix/ventas') }, "salix.ventas"); }; -const pagos = () => { +export const pagos = () => { require.ensure([], () => { require('@salix/pagos') }, "salix.pagos"); diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 511f8e75b..76e417692 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -1,7 +1,7 @@ /** * export public module */ -export {NAME} from './module'; +export * from './module'; export * from './util'; export {NAME as RESOLVEDEFAULTCOMPONENT, ResolveDefaultComponent} from './resolveDefaultComponents' export {NAME as INTERPOLATE,Interpolate} from './interpolate' diff --git a/@salix/core/src/module.js b/@salix/core/src/module.js index 43b13f444..a3391528c 100644 --- a/@salix/core/src/module.js +++ b/@salix/core/src/module.js @@ -5,3 +5,4 @@ const DEPENDENCIES = getVendorDependencies(vendors) export const NAME = getModuleName('core'); export const module = vendors.ng.module(NAME,DEPENDENCIES); + diff --git a/@salix/crud/.gitignore b/@salix/crud/.gitignore new file mode 100644 index 000000000..b512c09d4 --- /dev/null +++ b/@salix/crud/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/@salix/crud/index.js b/@salix/crud/index.js index 9044df30e..9d8de2297 100644 --- a/@salix/crud/index.js +++ b/@salix/crud/index.js @@ -1,3 +1 @@ -import * as vendors from '@salix/vendor' -import * as core from '@salix/core' -console.log('crud'); \ No newline at end of file +export * from './src/crud'; \ No newline at end of file diff --git a/@salix/crud/package.json b/@salix/crud/package.json new file mode 100644 index 000000000..3f8fd3f3c --- /dev/null +++ b/@salix/crud/package.json @@ -0,0 +1,10 @@ +{ + "name": "@salix/crud", + "version": "0.0.0", + "description": "", + "main": "index.js", + "repository": { + "type": "git", + "url": "http://git.verdnatura.es:/salix" + } +} diff --git a/@salix/crud/src/crud.js b/@salix/crud/src/crud.js new file mode 100644 index 000000000..7d4627b16 --- /dev/null +++ b/@salix/crud/src/crud.js @@ -0,0 +1,4 @@ +export * from './module'; +export * from './customer/routes'; + +export {NAME as CUSTOMER_INDEX, COMPONENT as CUSTOMER_INDEX_COMPONENT} from './customer/index' \ No newline at end of file diff --git a/@salix/crud/src/customer/index/index.html b/@salix/crud/src/customer/index/index.html new file mode 100644 index 000000000..8470ef54c --- /dev/null +++ b/@salix/crud/src/customer/index/index.html @@ -0,0 +1 @@ +