How to parsing this URL AngularJS
<p>Im novice in Angular. I have to get data from this url:</p>

<pre><code>food?query=a&amp;tags=91,92
</code></pre>

<p>and send request to API by this URL:</p>

<pre><code>search?category-slug=food&amp;query=a&amp;tags[]=91,92
</code></pre>

<p>controller:</p>

<pre><code>$scope.urlParse = {};
$scope.urlParse['expand'] = 'profile';
$scope.urlParse['category-slug'] = $location.pathname();
$scope.urlParse['query'] = $location.search('query');
$scope.urlParse['tags[]'] = $location.search('tags');

getSearchResults($scope.searchPath,$scope.urlParse);
</code></pre>

<p>But request request does not work
whats problem ?</p>