I am new to AngularJS and trying to see if this is possible. I have looked at a lot of $http.get questions online but can't find an answer to this.
I have an api call that has three different parameter key possibilities.
$http.get(url, {params : {$scope.searchBy : $scope.value}})
$scope.searchBy is marked as a syntax error. It has 3 possible values from a dropdown list.
I tried var search = $scope.searchBy; but when I use {params : {search : $scope.value}} the value is "search" and not $scope.searchBy.
Any suggestions how this can be done without if statements and separate api calls?
Thank you.