Skip to content

Instantly share code, notes, and snippets.

@cloke
Forked from anonymous/gist:3105885
Created July 13, 2012 17:08
Show Gist options
  • Save cloke/3106024 to your computer and use it in GitHub Desktop.
Save cloke/3106024 to your computer and use it in GitHub Desktop.
Assume you are using a bound array named links that is defined like [{link: 'some link', title: 'my nifty link', active: true}, ...]
//in JS file. I will assume you have an app called MyApp that was create with Em.Application.create()
MyApp.linksController = Em.ArrayProxy.create({
content: [ { link: 'I am a link', title: 'I am a title', active: true } ]
});
<!-- Navbar
================================================== -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button"class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="./index.html">Bootstrap</a>
<div class="nav-collapse collapse">
<ul class="nav">
{{#each MyApp.linksController.conntent}}
<li {{bindAttr class="active"}}>
<a {{bindAttr href="link"}}>{{title}}</a>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment