This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
[htmlAnchorDirective] name on achor tag reloads the UI #6554
Closed
Description
Anchor tag with non empty name, reloads the page:
<a name='http://yahoo.com' value="value=4">link</a>
As per angular source code, does not comply with the ngClick unit test case behaviour. ( Might have leaked trough since we don't assert if the reload happened )
it('should execute ng-click but not reload when href empty string and name specified', function() {
element(by.id('link-4')).click();
expect(element(by.model('value')).getAttribute('value')).toEqual('4');
expect(element(by.id('link-4')).getAttribute('href')).toBe('');
});
Looks like it leaked trough the source code via commit @ f3de5b6
As per W3Schools http://www.w3schools.com/tags/att_a_name.asp
The <a> name attribute is not supported in HTML5. Use the id attribute instead.
Why does angular have to bother about handling "name" when its not supported by HTML5 ? Personally, it seems like a specific case quick fix, rather than a generic fix.
I would happy to submit code if this has not been addressed as of today.