blob: f7ab8ebc8cfe6c25e0cd3a49871c64afa7302d55 [file] [log] [blame]
Matteo Scandoloa5d03d52016-07-21 11:35:46 -07001/* eslint-disable angular/ng_module_name */
2(function () {
3 'use strict';
Arpit Agarwal34b63832016-08-08 11:59:45 -07004 console.log('hello1!');
Matteo Scandoloa5d03d52016-07-21 11:35:46 -07005 angular.module('ngXosLib', ['xos.helpers'])
6 .run(function(){
7 console.info('Dev Environment ready!')
8 })
9 .controller('testCtrl', function(){
Arpit Agarwal34b63832016-08-08 11:59:45 -070010 this.model = {
11 first_name: 'Jhon',
12 last_name: 'Doe',
13 }
Matteo Scandoloa5d03d52016-07-21 11:35:46 -070014 this.config = {
Arpit Agarwal34b63832016-08-08 11:59:45 -070015 exclude: ['password', 'last_login'],
16 formName: 'sampleForm',
17 actions: [
Matteo Scandoloa5d03d52016-07-21 11:35:46 -070018 {
Arpit Agarwal34b63832016-08-08 11:59:45 -070019 label: 'Save',
20 icon: 'ok', // refers to bootstraps glyphicon
21 cb: (user) => { // receive the model
22 console.log(user);
23 },
24 class: 'success'
Matteo Scandoloa5d03d52016-07-21 11:35:46 -070025 }
Arpit Agarwal34b63832016-08-08 11:59:45 -070026 ],
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 Scandoloa5d03d52016-07-21 11:35:46 -070059 };
Matteo Scandoloa5d03d52016-07-21 11:35:46 -070060 });
61})();