AngularJS Active Link / Menu Class
Here's a small directive that will add ".active" class to the currently active menu. I'll probably improve on it much later.
var app = angular.module('directives'); app.directive('activeHref', ['$window', function ($window) { return { compile: function (ele, attrs) { if ($window.location.hash === attrs.ngHref) { angular.element(ele).addClass('active'); } }, require: 'ngHref' }; }]);















