File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 66 * @restrict A
77 *
88 * @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+ *
1315 * The `ngHref` directive solves this problem.
1416 *
15- * The buggy way to write it:
17+ * The wrong way to write it:
1618 * <pre>
1719 * <a href="http://www.gravatar.com/avatar/{{hash}}"/>
1820 * </pre>
2628 * @param {template } ngHref any string which can contain `{{}}` markup.
2729 *
2830 * @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:
3033 <doc:example>
3134 <doc:source>
3235 <input ng-model="value" /><br />
You can’t perform that action at this time.
0 commit comments