UNPKG

valence-connect

Version:

Connect to Valence for requests coming from applications running in the Valence Portal

34 lines (32 loc) 1.15 kB
angular.module('customersApp', ['dataGrid', 'pagination', 'ngMaterial']) .controller('customersAppController', ['$scope', 'customersAppFactory', function($scope, customersAppFactory) { $scope.gridOptions = { data : [], urlSync : false, }; customersAppFactory.getData().then(function(responseData) { if (responseData.data.customers) { $scope.gridOptions.data = responseData.data.customers; } else if (responseData.data.msg) { // Display message using Valence dialog that an error // occurred getting the customers // Valence.util.Helper.showDialog('Error', responseData.data.msg, 'OK'); } }); }]) .factory('customersAppFactory', function($http) { return { getData : function() { return $http({ method : 'GET', url : '/valence/customers/queryAll', params : { rootName : 'customers', maxResults : 500, }, }); }, }; });