Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS UI Bootstrap Tabs that support routing

I would like to use AngularJS UI Bootstrap Tabs in my project, but I need it to support routing.

For example:

Tab         URL -------------------- Jobs       /jobs Invoices   /invoices Payments   /payments 

As far as I can tell from the source code, the current tabs and pane directives doesn't support routing.

What would be the best way to add routing?

like image 502
Misha Moroshko Avatar asked Jun 01 '13 11:06

Misha Moroshko


People also ask

What is UI routing in AngularJS?

Angular-UI-Router is an AngularJS module used to create routes for AngularJS applications. Routes are an important part of Single-Page-Applications (SPAs) as well as regular applications and Angular-UI-Router provides easy creation and usage of routes in AngularJS.

What is $state in AngularJS?

$stateProvider is used to define different states of one route. You can give the state a name, different controller, different view without having to use a direct href to a route. There are different methods that use the concept of $stateprovider in AngularJS.

What is Route provider in angular?

route contains two properties - templateUrl and controller . templateUrl property defines which HTML template AngularJS should load and display inside the div with the ngView directive. controller property defines which controllers should be used with the HTML template.


1 Answers

To add routing you typically use an ng-view directive. I'm not sure it's easy enough to modify angular UI to support what you're looking for, but here's a plunker showing roughly what i think you're looking for (it's not necessarily the best way of doing it - hopefully someone can give you a better solution or improve on this)

like image 197
Chris White Avatar answered Nov 11 '22 11:11

Chris White