Added .component syntax in ng-xos-lib
Change-Id: Icc6ff26cff1369038cc9684612f742af0a78c799
diff --git a/dev/main.js b/dev/main.js
index e858499..f7ab8eb 100644
--- a/dev/main.js
+++ b/dev/main.js
@@ -1,30 +1,61 @@
/* eslint-disable angular/ng_module_name */
(function () {
'use strict';
- console.log('hello!');
+ console.log('hello1!');
angular.module('ngXosLib', ['xos.helpers'])
.run(function(){
console.info('Dev Environment ready!')
})
.controller('testCtrl', function(){
-
- // TODO add styles
-
+ this.model = {
+ first_name: 'Jhon',
+ last_name: 'Doe',
+ }
this.config = {
- columns: [
+ exclude: ['password', 'last_login'],
+ formName: 'sampleForm',
+ actions: [
{
- label: '#',
- prop: 'id',
- },
- {
- label: 'Name:',
- prop: 'name',
+ label: 'Save',
+ icon: 'ok', // refers to bootstraps glyphicon
+ cb: (user) => { // receive the model
+ console.log(user);
+ },
+ class: 'success'
}
- ]
+ ],
+ fields: {
+ first_name: {
+ type: 'string',
+ validators: {
+ required: true
+ }
+ },
+ last_name: {
+ label: 'Surname',
+ type: 'string',
+ validators: {
+ required: true,
+ minlength: 10
+ }
+ },
+ details_field: {
+ label: 'Empty Object Field',
+ type: 'object',
+ properties: {
+ foo: {
+ label: 'FooLabel:',
+ type: 'string',
+ validators: {
+ required: true
+ }
+ },
+ bar: {
+ type: 'number'
+ }
+ }
+ }
+ }
};
-
- this.data = [
- {id: 1, name: 'Jhon'}
- ];
});
})();
\ No newline at end of file