location.path() of default route in RC router yields empty string
- I'm submitting a ...
- [x] bug report
- [ ] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.
Current behavior
In an example like the following, currentRoute would yield an empty string on the home component.
// ...
export class AppComponent {
public currentRoute: string;
constructor( private route: Router, private locate: location ) {
route.changes.subscribe(() => {
this.currentRoute = this.locate.path();
console.log(this.currentRoute);
});
}
}
Expected/desired behavior
- What is the expected behavior? The default route should have a path of '/', a name, or other identifier.
- What is the motivation / use case for changing the behavior? In the case where someone wants to determine if it is the default/home route.
- Please tell us about your environment: Mavericks, Webpack, Typescript
- Angular version: 2.0.0-rc.1
- Browser: [ all ]
- Language: [ all ]
How do the routes look like. Please provide a plunker that allows to reproduce.
@paynoattn the RC router isn't ready so you will run into lots of issues. If you were previously on the deprecated router, stay on that.
@brandonroberts Will the successor of the RC1 router preserve the structure of a beta router app? When I migrate NOW from beta to RC1 there are lots of changes and nothing works as before. Thus I plan to revert to the old beta router (deprecated router)
@bastienJS you have it backwards. The succesor of the beta router (@angular/router-deprecated) is the RC router. They share much the same structure but some of it, such as route configuration, is slightly different. I'm writing up a piece on the RC router here: https://medium.com/@paynoattn/routing-in-with-angular2s-new-rc-x-router-6321c4a3d835#.p3u8mx5pl
@brandonroberts I don't mind bugs I'm building a project locally and I wanted to try it out. I'm just creating the bug that I ran into using it so the dev team is aware.
@zoechi I'm working on the plunker, I'll post a link shortly.
@bastienJS @paynoattn the RC router as it is today is not what it will be once finished and that version of the RC router will receive no further updates.
@brandonroberts so should I just close this bug report?
@paynoattn yes. The issue itself of location.path() returning '' for the path of / is expected behavior
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.