Wrapping the watch in the elm.focus

Seems to bring the watch calls way down.
This commit is contained in:
Robert
2018-01-10 10:03:02 +01:00
parent ab523baf4f
commit 6e830c1171

View File

@@ -10,10 +10,14 @@ function noDirtyCheck() {
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
scope.$watch(function () {
ctrl.$pristine = false;
elm.focus(function () {
scope.$watch(function() {
ctrl.$pristine = false;
console.log("here");
});
});
}
};
}