-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
effort1: hoursfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues
Description
@matsko and @IgorMinar and I talked about this in the past.
Currently, we require all router-links to have their first element to start with either / or with ./:
<a [router-link]="[ '/MyCmp' ]"></a>
For apps with one level of routing, the distinction between routing to a child and routing to a sibling is irrelevant. It'd be nice to omit the leading / or ./:
<a [router-link]="[ 'MyCmp' ]"></a>
We should change the behavior of generating the instruction (and subsequent link) to match a link DSL array with no leading ./ or / as follows:
For [router-link]="[ 'FooCmp' ]"
- Look for a child route named
FooCmp - Look for a sibling route named
FooCmp - If both exist, throw an error explaining the the developer must provide a leading
/or./so that the link is unambiguous. - Otherwise, if one exists, use the resolved instruction.
- If neither route matches, we throw an error telling the developer so.
This will help address some of the developer confusion WRT routes that's come up in our hackathons.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
effort1: hoursfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues