nl_tokens: @ngdoc method @name ngModel . NgModelController#$validate
pl_tokens: function ( ) { // ignore $validate before model is initialized if ( isNumberNaN ( this . $modelValue ) ) { return ; } var viewValue = this . $$lastCommittedViewValue ; // Note: we use the $$rawModelValue as $modelValue might have been // set to undefined during a view -> model update that found validation // errors. We can't parse the view here, since that could change // the model although neither viewValue nor the model on the scope changed var modelValue = this . $$rawModelValue ; var prevValid = this . $valid ; <mask> prevModelValue = this . $modelValue ; var allowInvalid = this . $options . getOption ( 'allowInvalid' ) ; var that = this ; this . $$runValidators ( modelValue , viewValue , function ( allValid ) { // If there was no change in validity, don't update the model // This prevents changing an invalid modelValue to undefined if ( ! allowInvalid && prevValid !== allValid ) { // Note: Don't check this.$valid here, as we could have // external validators (e.g. calculated on the server), // that just call $setValidity and need the model value // to calculate their validity. that . $modelValue = allValid ? modelValue : undefined ; if ( that . $modelValue !== prevModelValue ) { that . $$writeModelToScope ( ) ; } } } ) ; }