1angular.module('util').factory('urlBuilder', function($httpParamSerializer) {
2 function buildUrl(url, params) {
3 var serializedParams = $httpParamSerializer(params);
4
5 if (serializedParams.length > 0) {
6 url += ((url.indexOf('?') === -1) ? '?' : '&') + serializedParams;
7 }
8
9 return url;
10 }
11
12 return buildUrl;
13});
14