Skip to content Skip to sidebar Skip to footer

Angularjs Path Not Changing, Even After Apply

I have a quick question about the chaning of a route trough a custom directive. I set up a menubar diretive and set up a link function. Everything in this function works correctly,

Solution 1:

try using $timeout -

$("#menubarStoreButton").click(function() {
    $('.active').removeClass('active');
    $(this).addClass('active');
    $timeout(function() {
        $location.path('/store');
    });
})

Solution 2:

I wonder if your path is already /store and you want to reload your page try navigate try $window.location.href = "/store"; ref: $location and $window

Post a Comment for "Angularjs Path Not Changing, Even After Apply"