integración oclazyload y ui router
This commit is contained in:
parent
d1a86633fc
commit
f42d6273eb
|
@ -1,3 +1,6 @@
|
||||||
import {bootstrap} from './bootstrap';
|
import {bootstrap} from './bootstrap';
|
||||||
import * as spliting from './spliting'
|
import * as spliting from './spliting';
|
||||||
|
import * as routes from './routes';
|
||||||
|
|
||||||
|
|
||||||
bootstrap();
|
bootstrap();
|
||||||
|
|
|
@ -13,5 +13,5 @@ export const bootstrap = () => {
|
||||||
if (!_element) {
|
if (!_element) {
|
||||||
throw new Error("element is not defined");
|
throw new Error("element is not defined");
|
||||||
}
|
}
|
||||||
ng.bootstrap(_element, [NAME]);
|
ng.bootstrap(_element, [NAME]);
|
||||||
};
|
};
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"name": "@salix/core",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "http://git.verdnatura.es:/salix"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
|
@ -1,19 +1,20 @@
|
||||||
const crud = () => {
|
export const crud = (lazy, resolve) => {
|
||||||
require.ensure([], () => {
|
require.ensure([], () => {
|
||||||
require('@salix/crud')
|
var module = require('@salix/crud');
|
||||||
|
resolve(lazy.load({name:'crud'}));
|
||||||
}, "salix.crud");
|
}, "salix.crud");
|
||||||
};
|
};
|
||||||
const compras = () => {
|
export const compras = () => {
|
||||||
require.ensure([], () => {
|
require.ensure([], () => {
|
||||||
require('@salix/compras')
|
require('@salix/compras')
|
||||||
}, "salix.compras");
|
}, "salix.compras");
|
||||||
};
|
};
|
||||||
const ventas = () => {
|
export const ventas = () => {
|
||||||
require.ensure([], () => {
|
require.ensure([], () => {
|
||||||
require('@salix/ventas')
|
require('@salix/ventas')
|
||||||
}, "salix.ventas");
|
}, "salix.ventas");
|
||||||
};
|
};
|
||||||
const pagos = () => {
|
export const pagos = () => {
|
||||||
require.ensure([], () => {
|
require.ensure([], () => {
|
||||||
require('@salix/pagos')
|
require('@salix/pagos')
|
||||||
}, "salix.pagos");
|
}, "salix.pagos");
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* export public module
|
* export public module
|
||||||
*/
|
*/
|
||||||
export {NAME} from './module';
|
export * from './module';
|
||||||
export * from './util';
|
export * from './util';
|
||||||
export {NAME as RESOLVEDEFAULTCOMPONENT, ResolveDefaultComponent} from './resolveDefaultComponents'
|
export {NAME as RESOLVEDEFAULTCOMPONENT, ResolveDefaultComponent} from './resolveDefaultComponents'
|
||||||
export {NAME as INTERPOLATE,Interpolate} from './interpolate'
|
export {NAME as INTERPOLATE,Interpolate} from './interpolate'
|
||||||
|
|
|
@ -5,3 +5,4 @@ const DEPENDENCIES = getVendorDependencies(vendors)
|
||||||
export const NAME = getModuleName('core');
|
export const NAME = getModuleName('core');
|
||||||
export const module = vendors.ng.module(NAME,DEPENDENCIES);
|
export const module = vendors.ng.module(NAME,DEPENDENCIES);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
node_modules
|
|
@ -1,3 +1 @@
|
||||||
import * as vendors from '@salix/vendor'
|
export * from './src/crud';
|
||||||
import * as core from '@salix/core'
|
|
||||||
console.log('crud');
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"name": "@salix/crud",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "http://git.verdnatura.es:/salix"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
export * from './module';
|
||||||
|
export * from './customer/routes';
|
||||||
|
|
||||||
|
export {NAME as CUSTOMER_INDEX, COMPONENT as CUSTOMER_INDEX_COMPONENT} from './customer/index'
|
|
@ -0,0 +1 @@
|
||||||
|
<div>index</div>
|
|
@ -0,0 +1,16 @@
|
||||||
|
import template from './index.html';
|
||||||
|
import {module} from '../../module';
|
||||||
|
|
||||||
|
export const NAME = 'customer.add';
|
||||||
|
export const COMPONENT = {
|
||||||
|
template: template,
|
||||||
|
controller: function() {
|
||||||
|
this.user = {name: 'world'};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.component(NAME, COMPONENT);
|
||||||
|
module.factory('hello',function(){return true});
|
||||||
|
module.controller('pepito',function(hello){
|
||||||
|
console.log(hello);
|
||||||
|
});
|
|
@ -0,0 +1,31 @@
|
||||||
|
import * as core from '@salix/core';
|
||||||
|
import * as index from './index';
|
||||||
|
|
||||||
|
core.module.config(function($stateProvider, $urlRouterProvider) {
|
||||||
|
|
||||||
|
$urlRouterProvider.otherwise("/");
|
||||||
|
|
||||||
|
$stateProvider
|
||||||
|
.state('index', {
|
||||||
|
url: "/index",
|
||||||
|
component: index.CUSTOMER_INDEX,
|
||||||
|
resolve:{
|
||||||
|
load:function(){
|
||||||
|
console.log('hello');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.state('add', {
|
||||||
|
url: "/add",
|
||||||
|
template: "<div>add</div>"
|
||||||
|
})
|
||||||
|
.state('edit', {
|
||||||
|
url: "/edit",
|
||||||
|
template: "<div>edit</div>"
|
||||||
|
})
|
||||||
|
.state('delete', {
|
||||||
|
url: "/delete",
|
||||||
|
template: "<div>delete</div>"
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
|
@ -0,0 +1,12 @@
|
||||||
|
import * as vendors from '@salix/vendor';
|
||||||
|
import * as core from '@salix/core';
|
||||||
|
|
||||||
|
//import {getModuleName,getVendorDependencies} from './util';
|
||||||
|
|
||||||
|
export const NAME = 'crud';
|
||||||
|
export const module = vendors.ng.module(NAME,[]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,11 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
{{1+1}}
|
{{1+1}}
|
||||||
|
<div ui-view></div>
|
||||||
|
<a ui-sref="index">index</a>
|
||||||
|
<a ui-sref="add">add</a>
|
||||||
|
<a ui-sref="edit">edit</a>
|
||||||
|
<a ui-sref="delete">delete</a>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="build/salix.app.js" selector="#app"></script>
|
<script type="text/javascript" src="build/salix.app.js" selector="#app"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
0 info it worked if it ends with ok
|
|
||||||
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'dev' ]
|
|
||||||
2 info using npm@1.4.21
|
|
||||||
3 info using node@v4.4.7
|
|
||||||
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
|
|
||||||
5 info predev salix-app@1.0.0
|
|
||||||
6 info dev salix-app@1.0.0
|
|
||||||
7 verbose unsafe-perm in lifecycle true
|
|
||||||
8 info salix-app@1.0.0 Failed to exec dev script
|
|
||||||
9 error salix-app@1.0.0 dev: `webpack --progress --colors --watch`
|
|
||||||
9 error Exit status 1
|
|
||||||
10 error Failed at the salix-app@1.0.0 dev script.
|
|
||||||
10 error This is most likely a problem with the salix-app package,
|
|
||||||
10 error not with npm itself.
|
|
||||||
10 error Tell the author that this fails on your system:
|
|
||||||
10 error webpack --progress --colors --watch
|
|
||||||
10 error You can get their info via:
|
|
||||||
10 error npm owner ls salix-app
|
|
||||||
10 error There is likely additional logging output above.
|
|
||||||
11 error System Linux 4.7.0-1-amd64
|
|
||||||
12 error command "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
|
|
||||||
13 error cwd /home/juan/Proyectos/salix
|
|
||||||
14 error node -v v4.4.7
|
|
||||||
15 error npm -v 1.4.21
|
|
||||||
16 error code ELIFECYCLE
|
|
||||||
17 verbose exit [ 1, true ]
|
|
|
@ -9,9 +9,9 @@
|
||||||
"url": "http://git.verdnatura.es:/salix"
|
"url": "http://git.verdnatura.es:/salix"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular": "^1.5.8",
|
"angular": "^1.4.1",
|
||||||
"angular-ui-router": "^0.3.1",
|
"angular-ui-router": "^0.2.15",
|
||||||
"oclazyload": "^1.0.9"
|
"oclazyload": "^0.6.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"webpack": "*",
|
"webpack": "*",
|
||||||
|
|
Loading…
Reference in New Issue