AngularJS How do I pre select the value of a dropdown when the value is retrieved from a webservice?

后端 未结 2 631
面向向阳花
面向向阳花 2021-01-06 09:19

Hello community been stuck on this one for a while...

Scenario: I have a dropdownlist which I pre-populate with values fetched from a service. Now

2条回答
  •  再見小時候
    2021-01-06 09:38

    Give value to your model in select tag

    In your controller asign

    $scope.selectedValue = 'Step 1';  //your selected value, assign it in any way you wish
    $scope.stepsInvolved = response['stepsInvolved'];
    

    I am assuming your object is assigned to "response"

    
    

提交回复
热议问题