var directive = { controller: ['$scope', '$timeout', function ($scope, $timeout) { $scope.upDisabled = true; $scope.downDisabled = true; $scope.assigned = null; $timeout(function () { $scope.form.assignedList.$pristine = false; });and a change in the template for the directive as well:
<div> <select class="form-control select-list" ng-change="onChanged(assigned)" multiple ng-model="assigned" name="assignedList" ng-options="assignedItem.descrip for assignedItem in assignedItems| orderBy: 'SortOrder' | filter: filterCriteria" ></select> </div>(just adding names for the lists, originally they didn't have name attribute).
><div class="form-group padd form-group-lg"> > <div class="container"> > <data-sm:duallist-directive ng-required="false" > unassigned-items-title="'@String.Format(Labels.availableX, Labels.modifiers)'" > unassigned-items="currentModifierGroup.unassignedItems" > assigned-items-title="'@String.Format(Labels.assignedX, Labels.modifiers)'" > assigned-items="currentModifierGroup.assignedItems" > sortable="false" > selected-item="currentModifierGroup.selectedItem"> > </data-sm:duallist-directive> > </div> > </div> > <div class="form-group"> > <label class="control-label col-md-2 col-lg-2" title="@Labels.Macros">@Labels.Macros:</label> > <div class="col-md-8 col-lg-8"> > <textarea class="form-control" > rows="5" > style="resize: none" > ng-model="currentModifierGroup.selectedItem.macro" > ng-model-options="{ allowInvalid: true }"></textarea> > </div> > </div>>
> <div> > <select class="form-control select-list" > ng-change="onChanged(assigned)" > multiple > ng-model="assigned" > ng-options="assignedItem.descrip for assignedItem in assignedItems| orderBy: 'SortOrder' | filter: filterCriteria" > ></select> > </div>>
> $scope.onChanged = function (assigned) { > $scope.selectedItem = assigned[0]; > }>
><select class="form-control select-list ng-valid ng-dirty ng-valid-parse ng-touched" >ng-change="onChanged(assigned)" multiple="" ng-model="assigned" >ng-options="assignedItem.descrip for assignedItem in assignedItems| orderBy: 'SortOrder' | filter: filterCriteria"><option value="0" label="Bonus - Day Visitor [**BONUS**,DAYVISITOR,BONUS]">Bonus - Day Visitor [**BONUS**,DAYVISITOR,BONUS]</option> ><option value="1" label="Creepy Crawlers [EVENTS,ACTIVITIES,CREEPYCRWL]">Creepy Crawlers [EVENTS,ACTIVITIES,CREEPYCRWL]</option> ><option value="2" label="Dinosaur Adventures [EVENTS,ACTIVITIES,DINOADVNTR]">Dinosaur Adventures [EVENTS,ACTIVITIES,DINOADVNTR]</option> ><option value="3" label="Face Painting [EVENTS,ACTIVITIES,FACEPAINT]">Face Painting [EVENTS,ACTIVITIES,FACEPAINT]</option></select>>