typeahead does not reset 'editable' flag when ng-model is changed from controller
I have typeahead input field with typeahead-editable='false'.
To reset validty after changing ng-model from controller I have to call
$scope.myForm.myField.$setValidity('editable', true);
It should be called by directive somewhere in function pushed to modelCtrl.$formatters
+1
I believe I am hitting the same issue, setting Pristine on the form doesn't remove the validation errors, for "typeahead-editable='false'" inputs. Maybe a 1.3 angular issue had to do the same hack of $setValidity manually, all other controls work just fine with pristine:
if($scope.myForm.$error.editable){
var typeaheadErrors = [].concat($scope.myForm.$error.editable);
angular.forEach(typeaheadErrors, function(control, key){
control.$setValidity('editable', true)
});
}
$scope.myForm.$setPristine();
@zorkus Can you setup a plunkr reproducing your problem? And have you tried if the master branch has this issue fixed?
I am not able to reproduce this based on current master here.
Closing as resolved. Feel free to open a new issue with a reproduction if this is still an issue.
Just a note to say I can see this was a bug in 1.3.8 and is now fixed in 1.4.3.
http://plnkr.co/edit/GX5lF5
All is well.