Skip to content

Commit ee7350d

Browse files
committed
Revert "fix($StateRefDirective): fix anchor check flaw angular-ui#1667"
This reverts commit 43cf25b.
1 parent 43cf25b commit ee7350d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/stateDirectives.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,40 @@ function stateContext(el) {
2424
* @restrict A
2525
*
2626
* @description
27-
* A directive that binds a link (`<a>` tag) to a state. If the state has an associated
28-
* URL, the directive will automatically generate & update the `href` attribute via
29-
* the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking
30-
* the link will trigger a state transition with optional parameters.
27+
* A directive that binds a link (`<a>` tag) to a state. If the state has an associated
28+
* URL, the directive will automatically generate & update the `href` attribute via
29+
* the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking
30+
* the link will trigger a state transition with optional parameters.
3131
*
32-
* Also middle-clicking, right-clicking, and ctrl-clicking on the link will be
32+
* Also middle-clicking, right-clicking, and ctrl-clicking on the link will be
3333
* handled natively by the browser.
3434
*
35-
* You can also use relative state paths within ui-sref, just like the relative
35+
* You can also use relative state paths within ui-sref, just like the relative
3636
* paths passed to `$state.go()`. You just need to be aware that the path is relative
37-
* to the state that the link lives in, in other words the state that loaded the
37+
* to the state that the link lives in, in other words the state that loaded the
3838
* template containing the link.
3939
*
4040
* You can specify options to pass to {@link ui.router.state.$state#go $state.go()}
4141
* using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,
4242
* and `reload`.
4343
*
4444
* @example
45-
* Here's an example of how you'd use ui-sref and how it would compile. If you have the
45+
* Here's an example of how you'd use ui-sref and how it would compile. If you have the
4646
* following template:
4747
* <pre>
4848
* <a ui-sref="home">Home</a> | <a ui-sref="about">About</a> | <a ui-sref="{page: 2}">Next page</a>
49-
*
49+
*
5050
* <ul>
5151
* <li ng-repeat="contact in contacts">
5252
* <a ui-sref="contacts.detail({ id: contact.id })">{{ contact.name }}</a>
5353
* </li>
5454
* </ul>
5555
* </pre>
56-
*
56+
*
5757
* Then the compiled html would be (assuming Html5Mode is off and current state is contacts):
5858
* <pre>
5959
* <a href="#/home" ui-sref="home">Home</a> | <a href="#/about" ui-sref="about">About</a> | <a href="#/contacts?page=2" ui-sref="{page: 2}">Next page</a>
60-
*
60+
*
6161
* <ul>
6262
* <li ng-repeat="contact in contacts">
6363
* <a href="#/contacts/1" ui-sref="contacts.detail({ id: contact.id })">Joe</a>
@@ -86,7 +86,7 @@ function $StateRefDirective($state, $timeout) {
8686
link: function(scope, element, attrs, uiSrefActive) {
8787
var ref = parseStateRef(attrs.uiSref, $state.current.name);
8888
var params = null, url = null, base = stateContext(element) || $state.$current;
89-
var newHref = null, isAnchor = element.prop("tagName").toUpperCase() === "A";
89+
var newHref = null, isAnchor = element.prop("tagName") === "A";
9090
var isForm = element[0].nodeName === "FORM";
9191
var attr = isForm ? "action" : "href", nav = true;
9292

0 commit comments

Comments
 (0)