Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Sub-routes are Broken #11888

Closed
marksalpeter opened this issue Jul 24, 2015 · 3 comments
Closed

Nested Sub-routes are Broken #11888

marksalpeter opened this issue Jul 24, 2015 · 3 comments

Comments

@marksalpeter
Copy link

Im using eager loading with sub routes. I made a new ember cli project to demo the bug:

https://github.com/marksalpeter/ember-nested-subroutes-bug.git

In the example, the foo and /foo/bar routes work as expected but the foo/bar/baz route doesn't render the correct loading template or automatically fallback to templates/foo/bar/baz/index.hbs when templates/foo/bar/baz.hbs isn't found. If you change templates/foo/bar/baz/index.hbs to templates/foo/bar/baz.hbs baz will render, but templates/foo/bar/baz/loading.hbs will not be used for its loading state.

Let me know if there's anything else I can do to help debug.

@pixelhandler
Copy link
Contributor

@marksalpeter I think the issue you ran into is not documented well:

Instead of:

Router.map(function() {
  this.route('foo', function() {
    this.route('bar', function() {
      this.route('baz');
    });
  });
});

Use a function with this.route so you can use the index and loading templates.

Router.map(function() {
  this.route('foo', function() {
    this.route('bar', function() {
      this.route('baz', function() {});
    });
  });
});

See: marksalpeter/ember-nested-subroutes-bug#1

@rwjblue
Copy link
Member

rwjblue commented Jul 31, 2015

@pixelhandler - Thanks for investigating and sending a PR showing the solution!

@marksalpeter
Copy link
Author

Thanks!

On Jul 31, 2015, at 7:07 PM, Bill Heaton notifications@github.com wrote:

@marksalpeter https://github.com/marksalpeter I think the issue you ran into is not documented well:

Instead of:

Router.map(function() {
this.route('foo', function() {
this.route('bar', function() {
this.route('baz');
});
});
});
Use a function with this.route so you can use the index and loading templates.

Router.map(function() {
this.route('foo', function() {
this.route('bar', function() {
this.route('baz', function() {});
});
});
});

Reply to this email directly or view it on GitHub #11888 (comment).

KTKate referenced this issue in emberjs/guides Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants