diff --git a/demo/app.js b/demo/app.js index 4296a47..2d42e35 100644 --- a/demo/app.js +++ b/demo/app.js @@ -19,7 +19,7 @@ app.config(qbTableSettingsProvider => { }); -app.controller('queryBuilderExampleCtrl', function($http, $scope) { +app.controller('queryBuilderExampleCtrl', function($http, $scope, $timeout) { $scope.spec = { _id: {type: 'objectId'}, name: {type: 'string'}, @@ -36,6 +36,7 @@ app.controller('queryBuilderExampleCtrl', function($http, $scope) { role: {type: 'string', enum: ['user', 'admin', 'root']}, status: {type: 'string', enum: ['pending', 'active', 'deleted']}, lastLogin: {type: 'date'}, + tags: [{type: 'mixed'}], }; $scope.query = { @@ -44,6 +45,7 @@ app.controller('queryBuilderExampleCtrl', function($http, $scope) { status: {$nin: ['deleted']}, sort: 'username', limit: 10, + tags: 'foo', }; @@ -51,12 +53,14 @@ app.controller('queryBuilderExampleCtrl', function($http, $scope) { $scope.data; $scope.count; $scope.refresh = ()=> { - console.log('REFRESH', $scope.query); - $http.get('api/data', {params: $scope.query}) - .then(res => $scope.data = res.data); + $timeout(()=> { + console.log('REFRESH', JSON.stringify($scope.query)); + $http.get('api/data', {params: $scope.query}) + .then(res => $scope.data = res.data); - $http.get('api/count', {params: $scope.query}) - .then(res => $scope.count = res.data.count); + $http.get('api/count', {params: $scope.query}) + .then(res => $scope.count = res.data.count); + }); } $scope.$on('queryBuilder.change', $scope.refresh); diff --git a/demo/index.html b/demo/index.html index fc508ed..906a29a 100644 --- a/demo/index.html +++ b/demo/index.html @@ -90,6 +90,7 @@

Warning - GitHub data unsupported

Website Company Role + Tags @@ -122,6 +123,7 @@

Warning - GitHub data unsupported

{{row.website}} {{row.company.name}} {{row.role}} + {{row.tags}} diff --git a/demo/testData.js b/demo/testData.js index dba5406..04f9d38 100644 --- a/demo/testData.js +++ b/demo/testData.js @@ -33,4 +33,5 @@ module.exports = [...Array(100)].map((i, offset) => ({ lastLogin: Math.random() > 0.5 ? faker.date.past() : faker.date.recent(), + tags: ['foo', 'bar'], }));