Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

Discuss resetNamespace option in router #1346

Closed

Conversation

tsmacdonald
Copy link

See also emberjs/ember.js#11251

The full documentation is found in-source here

@@ -84,7 +84,18 @@ the `{{outlet}}` of the `posts` template.
A nested route's names includes the names of its ancestors.
If you want to transition to a route (either
via `transitionTo` or `{{#link-to}}`), make sure to use the full route
name (`posts.new`, not `new`).
name (`posts.new`, not `new`). If you don't want to use the full route
name (e.g., because a resource can be accessed in multiple locations), use the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly why this section was removed. You CANNOT use the same route name for two routes. The only thing that restNamespace gives you is a shorter name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I change it to something like If you don't want to use that full name, you can refer to it just by the name of the child with the resetNamespace option (but note that this does not change the URL structure).?

Or if you really think that resetNamespace should be used rarely, then it should be removed from the final example on emberjs.com.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I would personally prefer it were removed, as I don't want to encourage it's use because the current router<->file system mapping starts breaking down. I'll bring it up for discussion.

@locks
Copy link
Contributor

locks commented Apr 19, 2016

I am closing this issue due to the factual errors pointed out above, as well as thinking that resetNamespace is an advanced, and possibly unnecessary. It should be unnecessary for most applications, and there are other ways, like a wrapping componnet.
One could argue for a cross-link to the Router.map documentation, but that would be a different conversation for a different issue :)

Thanks for your contribution @tsmacdonald!

@locks locks closed this Apr 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants