This commit is contained in:
Javi Gallego 2016-10-06 15:27:02 +02:00
parent 750845b9fe
commit 9995d815f9
6 changed files with 24 additions and 7 deletions

View File

@ -9,7 +9,7 @@ core.module.config(function($stateProvider, $urlRouterProvider) {
$stateProvider $stateProvider
.state('index', { .state('index', {
url: "/index", url: "/index",
template :'<customer-add></customer-add>', template :'<customer-index></customer-index>',
resolve: { resolve: {
loader: function($ocLazyLoad, $q){ loader: function($ocLazyLoad, $q){
return $q((resolve) => { return $q((resolve) => {

View File

@ -2,3 +2,4 @@ export * from './module';
export * from './customer/routes'; export * from './customer/routes';
export {NAME as CUSTOMER_INDEX, COMPONENT as CUSTOMER_INDEX_COMPONENT} from './customer/index' export {NAME as CUSTOMER_INDEX, COMPONENT as CUSTOMER_INDEX_COMPONENT} from './customer/index'
export {NAME as CUSTOMER_ADD, COMPONENT as CUSTOMER_ADD_COMPONENT} from './customer/index/add'

View File

@ -0,0 +1 @@
<vn-button text='customer add'></vn-button>

View File

@ -0,0 +1,16 @@
import template from './add.html';
import {module} from '../../module';
export const NAME = 'customerAdd';
export const COMPONENT = {
template: template,
bindings :{
users: '<'
},
controller :function($scope, $element, $attrs){
console.log(this.users);
}
};
module.component(NAME, COMPONENT);

View File

@ -1 +1 @@
<div>index from component</div> <customer-add users="$ctrl.users"></customer-add>

View File

@ -1,14 +1,13 @@
import template from './index.html'; import template from './index.html';
import {module} from '../../module'; import {module} from '../../module';
export const NAME = 'customerAdd'; export const NAME = 'customerIndex';
export const COMPONENT = { export const COMPONENT = {
template: template, template: template,
controller: function() { controller :function(){
this.user = {name: 'world'}; this.users = {id:10,name:"xxxx"};
} }
}; };
module.component(NAME, COMPONENT); module.component(NAME, COMPONENT);