Over-excitement... I'm still getting it wrong though...
In both our plunkr's it starts false (even though it's supposed to be true, 
since debugging in the if statement shows it is validated as true).
In addition, changing the select changes nothing in our state, even though 
it passes in the "true" part of the if statement.
Looking at c.$valid or c.$invalid show as correct when playing with the 
select box (again, during debugging). 
Even though the value of the $valid is true and the $invalid is false, only 
after typing anything in the text box, it changes the value of the validity 
in the view.
So there's still a bug - or I'm missing something fundamental.


On Tuesday, April 8, 2014 4:35:12 PM UTC+3, Yonatan Kra wrote:
>
> $observe!!! of course!
> I've just read about it 2 days ago... entering my 3rd month in Angular and 
> still finding new concepts to grasp every hour...
> thanks a lot!
>
> On Tuesday, April 8, 2014 4:32:49 PM UTC+3, Guilherme Meireles wrote:
>>
>> The ngModel changes we're triggered at different times for the input and 
>> the select.
>> Example:
>> 1) Type some text 101 characters long.
>> 2) Change the Select to 1:
>> 3) c.$setValidity('maxCharacter', false); is run on the select
>> 4) Type some text 99 characters long:
>> 5) c.$setValidity('maxCharacter', true); is run on the input but not on 
>> the select that is still with $valid == false
>>
>>
>> I think this is a fix:
>> http://plnkr.co/edit/HRLxerAt1lvhTInHhDXh?p=preview
>>
>> I just changed the scope.$watch(attrs.ngModel 
>> for attrs.$observe('validateMessageCharacter'
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to