Skip to content

Instantly share code, notes, and snippets.

@dylanjha
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylanjha/93bb3f817c43f4c94fcc to your computer and use it in GitHub Desktop.
Save dylanjha/93bb3f817c43f4c94fcc to your computer and use it in GitHub Desktop.
//route
.when('/users/:tab', {
templateUrl: 'views/users/index.html',
controller: 'UsersController'
})
// UsersController
.controller('HomeController', function ($scope, $http, $routeParams) {
$scope.tab = $routeParams.tab
})
<div>
<ul>
<li class="tab" ng-class="{active: 'tab === tab1' }">
<a ng-href="/#/users/tab1">Tab1</a>
</li>
<li class="tab" ng-class="{active: 'tab === tab2' }">
<a ng-href="/#/users/tab2">Tab2</a>
</li>
<li class="tab" ng-class="{active: 'tab === tab3' }">
<a ng-href="/#/users/tab3">Tab3</a>
</li>
</ul>
</div>
@dylanjha
Copy link
Author

dylanjha commented Mar 3, 2015

links

  • /users/tab1
  • /users/tab2
  • /users/tab3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment