-
Notifications
You must be signed in to change notification settings - Fork 27.5k
ng:href produces unclickable links on IE7 #352
Comments
I found one of the pieces of code responsible. /*
* Modifies the default behavior of html A tag, so that the default
action is prevented when href
* attribute is empty.
*
* The reasoning for this change is to allow easy creation of action
links with ng:click without
* changing the location or causing page reloads, e.g.:
* <a href="" ng:click="model.$save()">Save</a>
*/
angularWidget('a', function() {
this.descend(true);
this.directives(true);
return function(element) {
if (element.attr('href') === '') {
element.bind('click', function(event){
event.preventDefault();
});
}
};
}); for some reason this is affecting dynamically created links in IE7 even if (element.attr('href') === '' && element.attr('ng:click')) { |
Should be merged into master soon, thanks a lot for the reporting and suggesting solution as well... |
This issue turns out to be more complicated that the solution provided by vojta. Here is a fix that works for all the following cases:
The code:
Note that the code, unifies the the behavior of Vojta, can you please update your pull request and tests with my code above? thanks! |
ng:href was producing unclickable links, as the event propagation was stopped by 'a' widget All links in regression/issue-352.html were tested in: * Chrome 11 * Opera 11 * Firefox 4 * IE7, IE8 Closes angular#352
Angular is updating the href attribute properly, but clicking on the link does not result in location change.
The text was updated successfully, but these errors were encountered: