I'm currently using $location in my app so I can send parameters from the address bar to my $http GET request. Like so:
var params = $location.search();
$http.get(url, params).then(function(){
...
}
Is it possible to add an ng-click attribute onto an element in my view, so I can pass parameters into the address bar, so I can filter my GET request?
Something like so:
<div ng-click="genre=romance">Romance</div>
<div ng-click="genre=horror">Horror</div>
<div ng-click="year=2012">2012</div>
<div ng-click="year=2011">2011</div>
So when two buttons are clicked the queries chain themselves and url is transformed to: app.com/movies?genre=horror&year=2012, for example.
Is this possible with $location and am I going about this in the right way?
Any help is appreciated. Thanks in advance!