0

I have problem in setting the selected dropdown value from the server.

<select **class="form-control input-sm"** placeholder="Choose Email" 
ng-model="groupForm.email"  
ng-options="agentListl.email for agentListl in agentList track by agentListl.id">
</select>

I set the previously selected value from the server by setting the id for groupForm.email.

With this select, It works fine. But when I change the class from class="form-control input-sm" to class="select-full", it is not setting the previously selected value. But i can get the selected value.

enter image description here

1 Answer 1

1

Your ng-model must be the reference of any item from your array like groupform.email = useragentlistl[0]

Sign up to request clarification or add additional context in comments.

1 Comment

I tired the same way. Still it is not working with the class select-full. $.each($scope.agentList, function(i) { if($scope.agentList[i].id == data.email){ selectedAgent= $scope.agentList[i]; } });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.