3

I'm using following HTML code HTML:

<select style="width: 100%" name="multipleSelect" id="multipleSelect" ng-model="data.multipleSelect" multiple>
    <option ng-click="BRPTab.AddFilesToOpenorDelete(fileName)" ng-repeat="fileName in BRPTab.FileNames">{{fileName}}</option>
</select>

Here BRPTab is an Alias.

Script code:

scope.AddFilesToOpenorDelete = function (FileName) {
        scope.SelectedFiles = [];
        var request = { FileName: FileName };
        scope.SelectedFiles.push(request);
}

This is working fine in Chrome but not in IE. Please suggest.

6
  • 1
    may I know which IE version & angular version? And BRPTab stands for what? Commented Apr 26, 2016 at 8:01
  • Can you please any plnkr/fiddle? Commented Apr 26, 2016 at 8:05
  • @ELmissaouihabib IE version 11 Commented Apr 26, 2016 at 8:10
  • @PankajParkar IE 11, angular version 1.4.7, BRPTab stands for controller alias. Commented Apr 26, 2016 at 8:11
  • I changed it to : <select style="width: 100%" name="multipleSelect" id="multipleSelect" ng-model="data.multipleSelect" ng-change="BRPTab.AddFilesToOpenorDelete(data.multipleSelect[0])" multiple> <option ng-repeat="fileName in BRPTab.FileNames">{{fileName}}</option> </select> and it worked. Commented Apr 26, 2016 at 8:11

1 Answer 1

2

ng-click on options tag would not work. Do use ng-options directive then, that would make you code more cleaner.

<select style="width: 100%" name="multipleSelect" id="multipleSelect" 
  ng-model="data.multipleSelect" multiple 
  ng-options="fileName in BRPTab.FileNames"
  ng-change="BRPTab.AddFilesToOpenorDelete(data.multipleSelect)">
</select>
Sign up to request clarification or add additional context in comments.

Comments

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.