Splitted form component
diff --git a/views/ngXosViews/subscribers/src/js/main.js b/views/ngXosViews/subscribers/src/js/main.js
index 6665b6d..957f807 100644
--- a/views/ngXosViews/subscribers/src/js/main.js
+++ b/views/ngXosViews/subscribers/src/js/main.js
@@ -25,38 +25,29 @@
templateUrl: 'templates/subscribers-list.tpl.html',
controller: function(Subscribers){
- this.tableConfig = {
- filter: 'field',
- order: true,
- pagination: {
- pageSize: 10
- },
- columns: [
- {
- label: 'Name',
- prop: 'humanReadableName'
- },
- {
- label: 'Identity',
- prop: 'identity',
- type: 'object'
- },
- {
- label: 'Related Info',
- prop: 'related',
- type: 'object'
- }
- ]
- };
-
this.smartTableConfig = {
resource: 'Subscribers'
};
+
+ this.formConfig = {
+ 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'
+ }
+ ]
+ };
// retrieving user list
Subscribers.query().$promise
.then((users) => {
- this.users = users;
+ this.users = users[0];
})
.catch((e) => {
throw new Error(e);
diff --git a/views/ngXosViews/subscribers/src/templates/subscribers-list.tpl.html b/views/ngXosViews/subscribers/src/templates/subscribers-list.tpl.html
index bd14fd5..afd7178 100644
--- a/views/ngXosViews/subscribers/src/templates/subscribers-list.tpl.html
+++ b/views/ngXosViews/subscribers/src/templates/subscribers-list.tpl.html
@@ -1,3 +1,4 @@
-<!-- <xos-table config="vm.tableConfig" data="vm.users"></xos-table> -->
+
+<xos-form ng-model="vm.users" config="vm.formConfig"></xos-form>
<xos-smart-table config="vm.smartTableConfig"></xos-smart-table>
\ No newline at end of file