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 @@