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

Ember 2.10.0, setting component's 'template' property is not working anymore #14713

Closed
waleedq opened this issue Dec 12, 2016 · 2 comments
Closed

Comments

@waleedq
Copy link

waleedq commented Dec 12, 2016

Passing template property to component is not working anymore to reproduce this

app/components/foo-bar.js

import Ember from "ember";
import hbs from 'htmlbars-inline-precompile';

Ember.Component.extend({
  template: hbs`A TEMPLATE`
})

app/components/foo-bar.hbs

BEGIN {{yield}} END

Ember v2.9.1 will output: BEGIN A TEMPLATE END, but Ember v2.10.10 will output: BEGIN END

@locks
Copy link
Contributor

locks commented Dec 13, 2016

I believe that template is a v1.x API and you should actually be using layout. Can you work up a reproduction twiddle?

@waleedq
Copy link
Author

waleedq commented Dec 13, 2016

Thank you locks, yes you are right the template is replaced with layout, but in v2.9.1 anything passed to the template property was being yielded into the the layout. anyway it seems that the template property is removed in v2.10.0. as a fix for rendering a dynamic template inside a component one should use the partial helper followed by the template name.

{{partial template}}

This fixed my issue, but i think a deprecation message should have been added in past versions before removing the template property from the API, as there was no any indications that it will be removed.

Thank You, please let me know if you need a reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants