3

I am using ui-select2 in angularjs for remote data access. I am having a drop down, based on the value chosen in dropdown the URL present in the ajax call should change dynamically , so that I can get the data from that particular URL.

Is it possible to change the URL dynamically based on the value present in the dropdown?

Kevin Brown-Silva
  • 40,873
  • 40
  • 203
  • 237
Deepa Mani
  • 281
  • 2
  • 5
  • 14

1 Answers1

4

I've resolved this problem using function in ajax property:

ajax: {
            url: function () { return '/product/' +$scope.campaign.advertiser + '/tags/'; },
            ...
}
Ivan
  • 151
  • 6