How to set active tab style with AngularJS?

Posted by Jessica Taylor | Updated on

Want to set active tab style with AngularJS? A way to solve this without having to rely on URLs is to add a custom attribute to every partial during $routeProvider configuration, like this:

Expose $route in your controller:

Set the active class based on the current active tab:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers