Skip to content

Commit

Permalink
Added prop keepBindInitialValue to keep initivalValue listen
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascco committed Apr 27, 2018
1 parent 390ec65 commit e2a8106
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions angucomplete-alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@
unbindInitialValue = scope.$watch('initialValue', function(newval) {
if (newval) {
// remove scope listener
unbindInitialValue();
if(!scope.keepBindInitialValue) {
unbindInitialValue();
}
// change input
handleInputChange(newval, true);
}
Expand Down Expand Up @@ -821,7 +823,8 @@
fieldTabindex: '@',
inputName: '@',
focusFirst: '@',
parseInput: '&'
parseInput: '&',
keepBindInitialValue: '='
},
templateUrl: function(element, attrs) {
return attrs.templateUrl || TEMPLATE_URL;
Expand Down

0 comments on commit e2a8106

Please sign in to comment.