I am trying to highlight the highlighted item in the Bootstrap navigation bar. Here is my code:
<ul class="nav navbar-nav navbar-left" top-bar>
and directive:
a.directive('topBar', function () { return { restrict: 'AE', link: function (scope, elem, attrs) { $(elem).on("click", function () { $(elem).find(".active").removeClass("active"); $(this).parent().addClass("active"); }); } }
});
It only works if I delete class = "nav navbar-nav navbar-left". Otherwise, it does not fall into the directive. Any suggestions?
thanks
Mark source share