AngularJS custom directive $location.path not working -


    merchantapp.directive('logout', function(common,$location){ return {     restrict: 'a',              link: function (scope, element, attrs) {                                         element.click(function(){                   common.clearcookies();                          $location.path("/merchantlogin");                  })                                 } }; 

})

this custom directive. want redirect merchant login page. clearcookies function working fine, redirect working please help.....

add $scope.$apply() after changing


Comments