Skip to content

Instantly share code, notes, and snippets.

@dylanjha

dylanjha/view.html

Last active Aug 29, 2015
Embed
What would you like to do?
//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

This comment has been minimized.

Copy link
Owner Author

@dylanjha 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