javascript - Angularjs with bootstrap Modal -
i using plain angularjs bootstrap. trying create page user lands after login.
so deafult route "/" user lands landing.html
landing.html contains
<ul class="nav nav-pills"> <li role="presentation" class="active"><a href="#/landing">home</a></li> <li role="presentation"><a href="#/tags">tags</a></li> <li role="presentation"><a href="#/help">help</a></li> </ul>
my problem have nav homes tags , . on click selected button background should change. there form home (#/landing)
. have problem using ng-swipe
any appreciated.
controller
app.controller('indexctrl', function($scope,$http,$rootscope){ $('#mymodal').modal({ backdrop: 'static', keyboard: false }); $(".nav a").on("click", function(){ $(".nav").find(".active").removeclass("active"); $(this).parent().addclass("active"); }); });
my solution
<ul class="nav nav-tabs "> <li role="presentation" ng-class="{ active: makeactive('/')}"><a href="#/">home</a></li> <li role="presentation" ng-class="{ active: makeactive('/maps')}"><a href="#/maps">maps</a></li> <li role="presentation" ng-class="{ active: makeactive('/help')}"><a href="#/help">help</a></li> </ul>
and in controller
$scope.makeactive = function (viewlocation) { return viewlocation === $location.path(); };
this seems work how can add swipe gestures it.
Comments
Post a Comment