The dropdown menu that lists states works fine in Google Chrome, but duplicates groups in Internet Explorer. In Chrome, there are 2 groups, but in IE there are 4. How can I fix this issue in IE as well? Thank you.
Here is the code snippet:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<select ng-model="selectedName" ng-options="state.name + ' - ' + state.country group by state.country for state in states | filter: {country:model.country}:true | orderBy: ['-country', 'name']">
</select>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.states = [
{'name': 'Alabama', 'abbrev': 'AL', 'country': 'US'},
... (All States and Territories listed with abbreviations and countries)
{'name': 'Yukon', 'abbrev': 'YT', 'country': 'CA'}
];
});
</script>
<p>This example demonstrates how to populate a dropdown list using the ng-options directive.</p>
</body>
</html>