Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upng-click overrides ng-href (or plain href) #6671
Comments
|
Hi @smakus . Can you please provide with an example of the issue? Which version of Angular do you use? |
|
I just experienced the same issue both with href and ng-href |
|
The problem does not appear with the browser, but it appears with android 2.3 (at least, I do not have any other android version to test). Only ng-click will be called but not ng-href nor href. |
|
Same issue -- mobile web only, ios as well as android. |
|
Same here. code What I want to do is to make the state change and the navbar collapse when the user clicks the link. I don't want to make a function to address this issue, any ideas?
|
|
I don't think Angular does anything to prevent you from applying both the |
|
Same issue here, web is ok, just occur on mobile device. I just set href to empty and use ngClick. I use angular 1.48 |
|
@carinafu, are you using |
|
@gkalpak yes, I injected ngTouch. is that the cause to the problem? |
|
@carinafu, it might. (Note that |
|
@gkalpak I have tried, it still has same problem even if I remove ngTouch |
|
@carinafu, I can't reproduce the issue. If you can post a minimal demo (e.g. using CodePen, Plnkr etc) and some info on what devices/browsers the problem appears on, I'd be happy to investigate. |
|
I am having this issue as well since adding ng-touch. My example is exactly as above. a(ng-href="{{ 'public-device-offers' | route:[routeClassification] }}" ng-click="vm.mobileCollapse()") @mobileCollapse = () -> |
|
I have the same problem. It is working on desktop but doesn't on mobile devices. Any ideas what can be the problem? Angular version AngularJS v1.5.8 |
|
This is still an issue. I'm working on a Samsung Galaxy S7 (SM-G930F) device, Android version 6.0.1 Angular 1.5.8 I worked around it by wrapping the |
|
something like this :
In the above code, everytime when I click inside the main div only ng-click function works but how can I force to click on tag also? |
if you have an ng-click-click attribute in conjunction with an ng-href or plain href in an
<a>tag, the ng-href/href will be ignored, and the link will never change location of the browser. Ng-click's function will be called, but the location.href will never change.