Skip to content

Instantly share code, notes, and snippets.

@inluxc
Created April 21, 2015 13:31
Show Gist options
  • Save inluxc/3588ef9cb9b9e9db991d to your computer and use it in GitHub Desktop.
Save inluxc/3588ef9cb9b9e9db991d to your computer and use it in GitHub Desktop.
nav-bar.js
--------------------------------------------------------------------------------------
import {bindable} from 'aurelia-framework';
export class NavBar {
@bindable router = null;
constructor(){
console.log('Constructor');
this.App = System.App;
}
}
--------------------------------------------------------------------------------------
nav-bar.html
--------------------------------------------------------------------------------------
<template>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">
<i class="fa fa-home"></i>
<span>${router.title}</span>
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav" show.bind="App.isVisible">
<li repeat.for="row of router.navigation" class="${row.isActive ? 'active' : ''}">
<a href.bind="row.href">${row.title} ${isVisible}</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="loader" if.bind="router.isNavigating">
<i class="fa fa-spinner fa-spin fa-2x"></i>
</li>
</ul>
</div>
</nav>
</template>
--------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment