acute-select
acute-select copied to clipboard
Updating model doesn't update items in drop dwon
Doesn't seem like if I change the model, the drop down items get updated?
Found a work around for this. Looks like the acRefresh was not finished. Temporarily, I added "refresh" variable based upon ac-refresh and set the $watch on refresh.
angular.module("acute.select", []) .directive("acSelect", function ($parse, acuteSelectService) { var defaultSettings = acuteSelectService.getSettings(); return { restrict: "EAC", scope: { "acSettings": "@", "acOptions": "@", "model": "=acModel", "acChange": "&", "keyField": "@acKey", "acRefresh": "=", "refresh": "=acRefresh" },
$scope.$watch("refresh", function (newValue, oldValue) {
if (newValue != oldValue) {
$scope.initialise();
}
});
This solves the problem with the update, but we don't need to use
if (newValue != oldValue)
Because $watch is only called when the newValue !== oldValue
Awesome! thank you @sibeliusseraphini