Started xosForm docs
diff --git a/views/ngXosLib/gulp/ngXosHelpers.js b/views/ngXosLib/gulp/ngXosHelpers.js
index f046681..5ff7d00 100644
--- a/views/ngXosLib/gulp/ngXosHelpers.js
+++ b/views/ngXosLib/gulp/ngXosHelpers.js
@@ -58,6 +58,7 @@
scripts: [
'http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js',
'http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-animate.min.js',
+ 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.11.2/lodash.js',
`${options.ngXosVendor}ngXosHelpers.js`
],
styles: [
diff --git a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/form.component.js b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/form.component.js
index 4d53a92..35fe286 100644
--- a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/form.component.js
+++ b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/form.component.js
@@ -35,17 +35,31 @@
* @element ANY
* @scope
* @example
- <example module="sampleAlert1">
+ <example module="sampleForm">
<file name="index.html">
- <div ng-controller="SampleCtrl1 as vm">
-
+ <div ng-controller="SampleCtrl as vm">
+ <xos-form ng-model="model" config="config"></xos-form>
</div>
</file>
<file name="script.js">
- angular.module('sampleAlert1', ['xos.uiComponents'])
- .controller('SampleCtrl1', function(){
- this.config1 = {
- exclude: ['password', 'last_login']
+ angular.module('sampleForm', ['xos.uiComponents'])
+ .controller('SampleCtrl', function(){
+ this.model = {
+
+ }
+ this.config = {
+ exclude: ['password', 'last_login'],
+ formName: 'sampleForm',
+ actions: [
+ {
+ label: 'Save',
+ icon: 'ok', // refers to bootstraps glyphicon
+ cb: (user) => { // receive the model
+ console.log(user);
+ },
+ class: 'success'
+ }
+ ]
};
});
</file>
diff --git a/views/ngXosViews/sampleView/env/default.js b/views/ngXosViews/sampleView/env/default.js
index 40d6f99..00512d7 100644
--- a/views/ngXosViews/sampleView/env/default.js
+++ b/views/ngXosViews/sampleView/env/default.js
@@ -8,6 +8,6 @@
module.exports = {
host: 'http://xos.dev:9999/',
- xoscsrftoken: 'WNQMpHGMRQQ2OKCthe4Dn1jahGRAkPhA',
- xossessionid: '7jjj6iogkyyrvdks93dhlk6mr311kl2l'
+ xoscsrftoken: '9vrMWJNfhfV8DcpOsJ7s8RQNIKV94xHP',
+ xossessionid: 'nn3tfg7j55hnvx67jgfvvo8cwnqvgex3'
};
diff --git a/views/ngXosViews/sampleView/src/js/main.js b/views/ngXosViews/sampleView/src/js/main.js
index 6f4d045..f8473b6 100644
--- a/views/ngXosViews/sampleView/src/js/main.js
+++ b/views/ngXosViews/sampleView/src/js/main.js
@@ -65,10 +65,8 @@
this.formConfig = {
exclude: ['password'],
+ formName: 'myForm',
fields: {
- last_login: {
- type: 'date'
- }
},
actions: [
{
diff --git a/views/ngXosViews/sampleView/src/templates/users-list.tpl.html b/views/ngXosViews/sampleView/src/templates/users-list.tpl.html
index f79f9ba..17ad68f 100644
--- a/views/ngXosViews/sampleView/src/templates/users-list.tpl.html
+++ b/views/ngXosViews/sampleView/src/templates/users-list.tpl.html
@@ -7,7 +7,7 @@
<div class="row">
<div class="col-xs-12">
- <!-- <xos-form ng-model="vm.users[0]" config="vm.formConfig"></xos-form> -->
+ <xos-form ng-model="vm.users[0]" config="vm.formConfig"></xos-form>
</div>
</div>