File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 6
6
* @restrict A
7
7
*
8
8
* @description
9
- * Using Angular markup like {{hash}} in an href attribute makes
10
- * the page open to a wrong URL, if the user clicks that link before
11
- * angular has a chance to replace the {{hash}} with actual URL, the
12
- * link will be broken and will most likely return a 404 error.
9
+ * Using Angular markup like `{{hash}}` in an href attribute will
10
+ * make the link go to the wrong URL if the user clicks it before
11
+ * Angular has a chance to replace the `{{hash}}` markup with its
12
+ * value. Until Angular replaces the markup the link will be broken
13
+ * and will most likely return a 404 error.
14
+ *
13
15
* The `ngHref` directive solves this problem.
14
16
*
15
- * The buggy way to write it:
17
+ * The wrong way to write it:
16
18
* <pre>
17
19
* <a href="http://www.gravatar.com/avatar/{{hash}}"/>
18
20
* </pre>
26
28
* @param {template } ngHref any string which can contain `{{}}` markup.
27
29
*
28
30
* @example
29
- * This example uses `link` variable inside `href` attribute:
31
+ * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes
32
+ * in links and their different behaviors:
30
33
<doc:example>
31
34
<doc:source>
32
35
<input ng-model="value" /><br />
You can’t perform that action at this time.
0 commit comments