Nope.  That's not how it works... you must specify the routes in order of 
literals first as Sander mentioned, and, as  you found when trying it out. 
 Precedence is given on first rule that matches, not on looking through all 
the rules and guessing what the user wants.  


On Monday, March 3, 2014 11:46:42 AM UTC-7, Matt Hughes wrote:
>
> Well, the router could take that into account, no?  If it has two routes 
> that match and one has a literal and the other has a matcher, the literal 
> should have precedence.
>
> On Saturday, March 1, 2014 12:41:18 AM UTC-5, Sander Elias wrote:
>>
>> Hi Matt,
>>
>> Short answer, No.
>> Somewhat longer, the /:bar is a 'catch all' construct. How can it know 
>> that you don't want to handle 'baz' as an variable? 
>> In this case it is very obvious, but if your router grows, or is build 
>> more dynamically  that might not be the case.  
>>
>> 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/groups/opt_out.

Reply via email to