From 9995d815f93b47446e6b10085197f0637ba9d955 Mon Sep 17 00:00:00 2001 From: Javi Gallego Date: Thu, 6 Oct 2016 15:27:02 +0200 Subject: [PATCH] crud add --- @salix/app/src/routes.js | 2 +- @salix/crud/src/crud.js | 3 ++- @salix/crud/src/customer/index/add.html | 1 + @salix/crud/src/customer/index/add.js | 16 ++++++++++++++++ @salix/crud/src/customer/index/index.html | 2 +- @salix/crud/src/customer/index/index.js | 7 +++---- 6 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 @salix/crud/src/customer/index/add.html create mode 100644 @salix/crud/src/customer/index/add.js diff --git a/@salix/app/src/routes.js b/@salix/app/src/routes.js index 4259fcd63..25d5fd78d 100644 --- a/@salix/app/src/routes.js +++ b/@salix/app/src/routes.js @@ -9,7 +9,7 @@ core.module.config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('index', { url: "/index", - template :'', + template :'', resolve: { loader: function($ocLazyLoad, $q){ return $q((resolve) => { diff --git a/@salix/crud/src/crud.js b/@salix/crud/src/crud.js index 7d4627b16..806f1c41a 100644 --- a/@salix/crud/src/crud.js +++ b/@salix/crud/src/crud.js @@ -1,4 +1,5 @@ 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 +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' \ No newline at end of file diff --git a/@salix/crud/src/customer/index/add.html b/@salix/crud/src/customer/index/add.html new file mode 100644 index 000000000..308197934 --- /dev/null +++ b/@salix/crud/src/customer/index/add.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/@salix/crud/src/customer/index/add.js b/@salix/crud/src/customer/index/add.js new file mode 100644 index 000000000..903b4606f --- /dev/null +++ b/@salix/crud/src/customer/index/add.js @@ -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); \ No newline at end of file diff --git a/@salix/crud/src/customer/index/index.html b/@salix/crud/src/customer/index/index.html index bf833f5d0..1f45f7a81 100644 --- a/@salix/crud/src/customer/index/index.html +++ b/@salix/crud/src/customer/index/index.html @@ -1 +1 @@ -
index from component
\ No newline at end of file + \ No newline at end of file diff --git a/@salix/crud/src/customer/index/index.js b/@salix/crud/src/customer/index/index.js index 3f404ca5a..31b48466b 100644 --- a/@salix/crud/src/customer/index/index.js +++ b/@salix/crud/src/customer/index/index.js @@ -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);