After adding a select all button to a multiple select, I encountered an issue. Although all the items are being selected, they are not highlighted when clicking on the select all button.
Below is the code snippet:
<div class="label_hd">Profiles* {{user.profile}}
<input type="button" id="select_all" ng-click="selectedAll()"
name="select_all" value="Select All" style="margin-left: 10px">
</div>
<select multiple class="browser-default" name="userprofile"
id="userprofile" ng-model="user.profile">
<option ng-repeat="profile in userprofiles" value="{{profile.profile}}">
{{ profile.profile_name }}
</option>
</select>
Controller.js code:
$scope.selectedAll = function(){
$scope.user.profile = [];
angular.forEach($scope.userprofiles, function(item){
$scope.user.profile.push( item.profile);
});
}