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
.state('index', {
url: "/index",
template :'<customer-add></customer-add>',
template :'<customer-index></customer-index>',
resolve: {
loader: function($ocLazyLoad, $q){
return $q((resolve) => {

View File

@ -1,4 +1,5 @@
export * from './module';
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 {module} from '../../module';
export const NAME = 'customerAdd';
export const NAME = 'customerIndex';
export const COMPONENT = {
template: template,
controller: function() {
this.user = {name: 'world'};
controller :function(){
this.users = {id:10,name:"xxxx"};
}
};
module.component(NAME, COMPONENT);