0

I use Angular chosen to add styles to default select tag in HTML. It works fine when i push my data object to select tag on page load.

But i want to load the list dynamically when other selection list is selected. It does not work here. When i remove the chosen directive it works fine. Here is my code . Thanks

HTML

<select chosen ng-model="list_sno"  ng-options="sl.List_Name for sl in sourcelists" > </select> 

JS

myService.getSourcelistsforSource(source_sno).then(
function(data){ 
$scope.sourcelists = data;
});
Srinivasan
  • 293
  • 1
  • 6
  • 16

1 Answers1

0

Wrap the code in $timeout like this

$timeout(function(){
    $scope.sourcelists =data;   
    },0);

Dont forget to add $timeout dependency above.

Hussain Mohd
  • 126
  • 7