I am trying to use href and ng-click in a tag.
<a href="#/home" ng-click="ctl.modify()"> </a>
When I use href and ng-click in a tag, ng-click is working but href is not working.
Please let me know how to make href work?
I am trying to use href and ng-click in a tag.
<a href="#/home" ng-click="ctl.modify()"> </a>
When I use href and ng-click in a tag, ng-click is working but href is not working.
Please let me know how to make href work?
Try this code:
HTML code:
<a ng-click="go('/home')"></a>
JS code:
$scope.go = function ( path ) {
$location.path( path );
};
In your ctl.modify()
function you have to add this row:
$location.path('/home');
Don't forget to add $location as a dependency in the controller params.