I created a blog where I've got a {{downloads}}
component showing the downloads which belong to a post. Currently I render the downloads below {{{post.content}}}
.
I'd like to have a special string withing post.content
like [postDownloads] and render {{downloads}}
there.
Is this somehow possible or are there other approaches to solve this problem?
Here is a jsbin: http://ift.tt/1FA8lkA (without a component)
App = Ember.Application.create();
App.Router.map(function() {
// put your routes here
});
App.IndexRoute = Ember.Route.extend({
model: function() {
return {title: "cool post title",
content: "<p>Lorem ipsum</p>[postDownloads]<p>coool stuff</p>"};
}
});
This is an example to illustrate my request:
<script type="text/x-handlebars">
<h2>My Blog example</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="index">
{{#with model as post}}
<h3>{{post.title}}</h3>
<div>{{{post.content}}}</div>
{{/with}}
</script>
Aucun commentaire:
Enregistrer un commentaire