1

I am facing an issue. I am using angular dropdown directive for custom select box. here is the git repo for dropdown.

When ever i change the dropdown's value from any event , it replace the value for next selected value.

steps to reproduce

  1. clickme : it will set option3 in DDL
  2. now change it option2
  3. again open the DDL , now it have replaced the option3 to option2

Thanks.

2

1 Answer 1

1

I have made some changes in the fiddle please check this Modified Fiddle

 $scope.change = function()
{
    $scope.ddSelectSelected ={ text: $scope.ddSelectOptions[0].text,
                              someprop:     $scope.ddSelectOptions[0].text}

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

2 Comments

Thanks madhu, You saved my day. but should we consider this as directive bug or not?
No it is not a bug. We assigned the scope variable ddSelectOptions[0] directly to another scope variable ddSelectSelected and hence changes in ddSelectSelected reflected in ddSelectOptions also...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.