Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 1 | /* eslint-disable angular/ng_module_name */ |
| 2 | (function () { |
| 3 | 'use strict'; |
Arpit Agarwal | 34b6383 | 2016-08-08 11:59:45 -0700 | [diff] [blame] | 4 | console.log('hello1!'); |
Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 5 | angular.module('ngXosLib', ['xos.helpers']) |
| 6 | .run(function(){ |
| 7 | console.info('Dev Environment ready!') |
| 8 | }) |
| 9 | .controller('testCtrl', function(){ |
Arpit Agarwal | 34b6383 | 2016-08-08 11:59:45 -0700 | [diff] [blame] | 10 | this.model = { |
| 11 | first_name: 'Jhon', |
| 12 | last_name: 'Doe', |
| 13 | } |
Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 14 | this.config = { |
Arpit Agarwal | 34b6383 | 2016-08-08 11:59:45 -0700 | [diff] [blame] | 15 | exclude: ['password', 'last_login'], |
| 16 | formName: 'sampleForm', |
| 17 | actions: [ |
Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 18 | { |
Arpit Agarwal | 34b6383 | 2016-08-08 11:59:45 -0700 | [diff] [blame] | 19 | label: 'Save', |
| 20 | icon: 'ok', // refers to bootstraps glyphicon |
| 21 | cb: (user) => { // receive the model |
| 22 | console.log(user); |
| 23 | }, |
| 24 | class: 'success' |
Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 25 | } |
Arpit Agarwal | 34b6383 | 2016-08-08 11:59:45 -0700 | [diff] [blame] | 26 | ], |
| 27 | fields: { |
| 28 | first_name: { |
| 29 | type: 'string', |
| 30 | validators: { |
| 31 | required: true |
| 32 | } |
| 33 | }, |
| 34 | last_name: { |
| 35 | label: 'Surname', |
| 36 | type: 'string', |
| 37 | validators: { |
| 38 | required: true, |
| 39 | minlength: 10 |
| 40 | } |
| 41 | }, |
| 42 | details_field: { |
| 43 | label: 'Empty Object Field', |
| 44 | type: 'object', |
| 45 | properties: { |
| 46 | foo: { |
| 47 | label: 'FooLabel:', |
| 48 | type: 'string', |
| 49 | validators: { |
| 50 | required: true |
| 51 | } |
| 52 | }, |
| 53 | bar: { |
| 54 | type: 'number' |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | } |
Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 59 | }; |
Matteo Scandolo | a5d03d5 | 2016-07-21 11:35:46 -0700 | [diff] [blame] | 60 | }); |
| 61 | })(); |