Reputation: 5115
Let's say I have a component called MyComponent. Is there anyway I can render that component into an outlet like I would with a regular template.
I am calling render from a Route. The reason I'm using a component is because I want to reuse a lot of my HTML, but also want to take advantage of the "public API" like aspects of components.
Can I achieve this with Ember? Thanks for your help.
Upvotes: 0
Views: 134
Reputation: 6947
Sure, you can specify a template id or the actual template content itself in a view. Instead of using the templateName
property, set the template
property lke this:
App.MyComponentView= Ember.View.extend({
template: Ember.Handlebars.compile("{{my-component}}");
});
Hope that helps.
Upvotes: 0