Skip to content

Instantly share code, notes, and snippets.

@derwolfe
Created November 7, 2013 18:14
Show Gist options
  • Save derwolfe/7359275 to your computer and use it in GitHub Desktop.
Save derwolfe/7359275 to your computer and use it in GitHub Desktop.
angular.module('App', ['restangular'])
.config(function(RestangularProvider) {
RestangularProvider.setBaseUrl('/api');
RestangularProvider.setDefaultHeaders({
"headers": { "common": { "Accept": "application/json" } }
});
})
.service('StaticsService', ['$scope', 'Restangular',
function($scope, Restangular) {
$scope.commodities = Restangular.all('commodities').getList();
$scope.commodityTypes = Restangular.all('commoditytypes').getList();
$scope.portfolios = Restangular.all('portfolios').getList();
$scope.counterparties = Restangular.all('counterparties').getList();
}])
.controller('LimitsListController', ['$scope', 'StaticsService', 'Restangular',
function ($scope, Restangular, StaticsService) {
$scope.limits = Restangular.all('limits').getList();
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment