In an AngularJS application I have the following code:
<a target="_blank" ng-href="{{someProperty.href}}" ng-click="someMethod($event)">Hello!</a>
Now, someMethod() and someProperty belong to the same service.
Initially, someProperty.href has a default value.
What I need to do is that when the user clicks on the link, some calculation is performed and someProperty.href gets a new value. This new value need to be reflected in the ng-href and the user should be redirected to that new href.
make sure the value in href tag is updated after you click on it. Try debugging the ng-click function. According to the official documentation:
In your case, i think the old link is not getting updated with the new values of the model. Hence, redirecting to old link.