I am using Angular material and I am stuck on multi selection dropdown , where I was selecting more than one options and on ng-change I am calling function which will get id of every option and I will compare API id but As I select it will provide data in function like In first option selection 123456 In second option selection 123456,456231
In Third option selection 123456,456231,471258
so whenever I do compare It goes inside the condition only once and not more even I tried to split It gives error and do nothing.
<md-select ng-model="$parent.follower" placeholder="Select Person" multiple="true" ng-change="getFollowers(follower)">
<md-option ng-repeat="follower in followers" value="{{follower.id}}"> {{follower.full_name}}</md-option>
</md-select>
So Let me know how to handle this situation, if anyone have experience and very well Please let me know.
Thanks Shivam
I have created Codepen for you where you can see the value changing each time As I dont know you data format I used a demo one
HTML
Angularjs Code
Codepen for working solution http://codepen.io/anon/pen/WvygLZ