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

The bool value for testing if parentTemplate was recursive was wrong #1916

Merged
merged 1 commit into from
Jan 29, 2013
Merged

The bool value for testing if parentTemplate was recursive was wrong #1916

merged 1 commit into from
Jan 29, 2013

Conversation

joeytrapp
Copy link

Now passing true on first run prevents the warning and passing false for
subsequent runs triggers the warning.

Now passing true on first run prevents the warning and passing false for
subsequent runs triggers the warning.
@KasperTidemann
Copy link
Contributor

👍

wagenet added a commit that referenced this pull request Jan 29, 2013
The bool value for testing if parentTemplate was recursive was wrong
@wagenet wagenet merged commit 594c38b into emberjs:master Jan 29, 2013
@chrisvariety
Copy link
Contributor

After updating to RC1, I'm seeing this error throughout my application, though everything is working as expected.

Can anyone point me in the right direction for figuring out how to suppress this warning? Not sure where to add an render('tempate', {into: ...}) or what to set it to.

@joeytrapp
Copy link
Author

You will see the warning when a routes parent did not render in the the default 'main' outlet. In that case, the route has to look to its parents parent to find a template to render into. To surpress the warning, define the the into option on your render, which means that you understand that you are not following the conventional rendering chain.

@chrisvariety
Copy link
Contributor

Thanks for your response @joeytrapp! I don't mean to be going against the conventional rendering chain.

Here's a very simple jsfiddle demonstrating the warning (I get it twice!): http://fiddle.jshell.net/rp97D/1/

Just click 'Run' and then 'Edit' in the result window. If you have your console open, you should see two warnings.

I'm assuming I'm not creating/nesting my routes in a conventional way? Any advice would be greatly appreciated.

@joeytrapp
Copy link
Author

@ChrisMCC In the case of your fiddle, the lessons/edit template is first going to try to render into the lessons template. Since there is not a lessons template rendered, it has to look to the parents parent (which is course), but that doesn't exist either, so it will finally find the application template to render into. If this is what you expect/want, then things are working correctly. The warnings are only to point out that this may not be what you expect and you should look into it.

To get the same functionality without the warnings, add an application template and a LessonsEditRoute that implements renderTemplate(). This fiddle is basically the same thing, but I'm being more explicit about where my template is going.

@chrisvariety
Copy link
Contributor

Thank you so much @joeytrapp! You've been very helpful. The warnings are now gone and I feel like I have a better understanding of Ember. Much appreciated.

@akshayrawat
Copy link
Contributor

My 2 cents on this, after seeing this for a while. And I might be wrong as I don't understand things and their side effects in general.

Don't think these warnings are actually useful. There should be a debug flag instead which prints out this info instead. Almost 90% of my use cases render things into a non immediate parent. This is common default/fallback logic ... similar to how events propagate from views > controllers > routes.

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

Successfully merging this pull request may close these issues.

None yet

5 participants