Hi LLoyd,

Input and ngModel are quite complex. They have a lot to take care off. 
But this one is easy to explain. Say you want to add an directive that 
reacts on the input of an directive, it makes more sense to react on the 
"final" outcome.
the value after parsing can be very different from the value after 
$formatters. If you created those $formatters it makes sense that you want 
this in 
the first place. 
By putting it on a higher priority, you put your directive earlier in the 
execution order. This means you will work on the 'untouched' version of the 
data.

shortly said:
   directive normal priority, post processing
   directive higher priority, pre processing.

I also noticed that you used the $compile in an inefficient way.  While it 
may be needed in some cases to compile at the link level, this will kick of 
a extra 
digestion round, for every instance of your directive, and the template 
gets recompiled(a very costly operation!) for every instance too. In most 
scenarios this is not needed, 
and can you handle the compilation at the compile level.
Here is a modified version of you 
sample<http://plnkr.co/edit/IjN2DzIhnNfrz8DWwQzP?p=preview>that shows what I 
mean.

Regards
Sander
 

-- 
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