Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

header not updating when change option specified- fix #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@ angular.module('am.multiselect', [])
scope.$watch(function () {
return modelCtrl.$modelValue;
}, function (newVal, oldVal) {
getHeaderText();
// when directive initialize, newVal usually undefined. Also, if model value already set in the controller
// for preselected list then we need to mark checked in our scope item. But we don't want to do this every time
// model changes. We need to do this only if it is done outside directive scope, from controller, for example.
if (angular.isDefined(newVal)) {
markChecked(newVal);
scope.$eval(changeHandler);
}
getHeaderText();

modelCtrl.$setValidity('required', scope.valid());
}, true);

Expand Down