Is there an easier/shorte/AngularJS way to make the conversion of parameters from URL to a JavaScript object shorter than
JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}')
(the answer above pulled from SO https://stackoverflow.com/questions/8648892/convert-url-parameters-to-a-javascript-object
What needs to be done is to convert a long string with many parameters such as
field1=value1&field2=value2...
into an object
Object {field1: "value1",field2: "value2",...}