-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ng-href should accept empty values #10175
Comments
Why not just do |
That would do but sounds more like a workaround then a solution. Also, those links are generated automatically through a breadcrumb directive and when i need to change the base url, having to change it on two places doesn't look like a good choice. |
If I understand correctly you want For some reason there is this code: angular.js/src/ng/directive/attrs.js Lines 408 to 410 in 14b3db3
which seems to be the reason why this is not happening. I don't know why this line is here. |
Basically, there are two things going on here:
The reasoning for (1) is that an empty would point to the base href, but it is debatable if this is more of a feature than a bug. Basically, it would be nice to have a way to indicate when we want Regarding (2), when base href comes into play, it is again debatable if an empty |
@gkalpak so there is no way to create a link to the base url, right? To make it work, i would need to change both places you said, but then it can/will break other stuff, right? |
Not sure what two places you are referring to, but it seems that the only way to create a (working) link to the base url is to have the link's href equal the base url. |
The html way is href="." Not sure if this works in angular |
Aha, indeed it works (both with |
With @gkalpak validation that |
works perfectly, really nice solution! Thanks @lgalfaso |
Angular doesn't allow me to create a link to my base url.
This should create an achor pointing to "http://localhost/app/". But it didn't even create the href attr.
But this works fine, pointing to "http://localhost/app/users".
This points me to "http://localhost/"
Also, this show the right href (http://localhost/app/) on mouseover, but angular doesn't change the page when i click.
I don't see how can this be achieved, it seems like a bug to me.
The text was updated successfully, but these errors were encountered: