@@ -24,40 +24,40 @@ function stateContext(el) {
24
24
* @restrict A
25
25
*
26
26
* @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.
31
31
*
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
33
33
* handled natively by the browser.
34
34
*
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
36
36
* 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
38
38
* template containing the link.
39
39
*
40
40
* You can specify options to pass to {@link ui.router.state.$state#go $state.go()}
41
41
* using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,
42
42
* and `reload`.
43
43
*
44
44
* @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
46
46
* following template:
47
47
* <pre>
48
48
* <a ui-sref="home">Home</a> | <a ui-sref="about">About</a> | <a ui-sref="{page: 2}">Next page</a>
49
- *
49
+ *
50
50
* <ul>
51
51
* <li ng-repeat="contact in contacts">
52
52
* <a ui-sref="contacts.detail({ id: contact.id })">{{ contact.name }}</a>
53
53
* </li>
54
54
* </ul>
55
55
* </pre>
56
- *
56
+ *
57
57
* Then the compiled html would be (assuming Html5Mode is off and current state is contacts):
58
58
* <pre>
59
59
* <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
+ *
61
61
* <ul>
62
62
* <li ng-repeat="contact in contacts">
63
63
* <a href="#/contacts/1" ui-sref="contacts.detail({ id: contact.id })">Joe</a>
@@ -86,7 +86,7 @@ function $StateRefDirective($state, $timeout) {
86
86
link : function ( scope , element , attrs , uiSrefActive ) {
87
87
var ref = parseStateRef ( attrs . uiSref , $state . current . name ) ;
88
88
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" ;
90
90
var isForm = element [ 0 ] . nodeName === "FORM" ;
91
91
var attr = isForm ? "action" : "href" , nav = true ;
92
92
0 commit comments