Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gen): Added navbar to starting template
Should make it easier to start building a multi-page app required for #36
- Loading branch information
Showing
9 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict' | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.controller 'NavbarCtrl', ['$scope', '$location', ($scope, $location) -> | ||
$scope.menu = [ | ||
title: 'Home' | ||
link: '/' | ||
, | ||
title: 'About' | ||
link: '#' | ||
, | ||
title: 'Contact' | ||
link: '#' | ||
] | ||
$scope.isActive = (route) -> | ||
route is $location.path() | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict' | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.controller 'NavbarCtrl', ($scope, $location) -> | ||
$scope.menu = [ | ||
title: 'Home' | ||
link: '/' | ||
, | ||
title: 'About' | ||
link: '#' | ||
, | ||
title: 'Contact' | ||
link: '#' | ||
] | ||
$scope.isActive = (route) -> | ||
route is $location.path() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.controller('NavbarCtrl', ['$scope', '$location', function ($scope, $location) { | ||
$scope.menu = [{ | ||
'title': 'Home', | ||
'link': '/' | ||
}, | ||
{ | ||
'title': 'About', | ||
'link': '#' | ||
}, | ||
{ | ||
'title': 'Contact', | ||
'link': '#' | ||
}]; | ||
|
||
$scope.isActive = function(route) { | ||
return route === $location.path(); | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.controller('NavbarCtrl', function ($scope, $location) { | ||
$scope.menu = [{ | ||
'title': 'Home', | ||
'link': '/' | ||
}, | ||
{ | ||
'title': 'About', | ||
'link': '#' | ||
}, | ||
{ | ||
'title': 'Contact', | ||
'link': '#' | ||
}]; | ||
|
||
$scope.isActive = function(route) { | ||
return route === $location.path(); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="header" ng-controller="NavbarCtrl"> | ||
<ul class="nav nav-pills pull-right"> | ||
<li ng-repeat="item in menu" ng-class="{active: isActive(item.link)}"> | ||
<a ng-href="{{item.link}}">{{item.title}}</a> | ||
</li> | ||
</ul> | ||
<h3 class="text-muted"><%= appname %></h3> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.header(ng-controller='NavbarCtrl') | ||
ul.nav.nav-pills.pull-right | ||
li(ng-repeat='item in menu', ng-class='{active: isActive(item.link)}') | ||
a(ng-href='{{item.link}}') {{item.title}} | ||
h3.text-muted <%= scriptAppName %> |