Friday, August 9, 2013

Creating complex static Markup with ember.js

Creating complex static Markup with ember.js

I am trying to render my application template, which is getting very
complicated, so I want to split it up into separate <script
type="text/x-handlebars">'s
I think I want to use the {{view}} helper, but I don't know. Let's say I
have this:
<script type="text/x-handlebars" data-template-name="application">
<div id="wrapper" class="clearfix">
<hgroup>
<header>
<div class="logo"></div>
<h1 id="facilityName">{{facilityName}}</h1>
<div id="sessionInfo">
<a id="userName">{{user}}</a>
<a id="logOut" href="../logout">log out</a>
</div>
</header>
</hgroup>

</div>
</script>
And I want to load this next template inside of the one above:
<script type="text/x-handlebars" id="breadcrumbs">
<div id="breadcrumbs">
<p>
<a href="{{breadcrumbObj.page}}">Network</a>

<span>&#62;</span><a >
</p>
</div>
</script>
Right now I am trying to do this with this code from my app.js
App.breadcrumbsView = Ember.View.create({
templateName: 'breadcrumbs',
breadcrumbObj: Util.breadcrumbs()
});
This is not working and I am getting Uncaught Error: assertion failed:
Unable to find view at path 'App.breadcrumbsView'
Thanks

No comments:

Post a Comment