docs(ngHref): fix formatting and clarify

Closes #4106
This commit is contained in:
Dave Peticolas 2013-09-22 13:03:05 -07:00 committed by Pete Bacon Darwin
parent f9bf194439
commit 5efc2ed5ac

View file

@ -6,13 +6,15 @@
* @restrict A * @restrict A
* *
* @description * @description
* Using Angular markup like {{hash}} in an href attribute makes * Using Angular markup like `{{hash}}` in an href attribute will
* the page open to a wrong URL, if the user clicks that link before * make the link go to the wrong URL if the user clicks it before
* angular has a chance to replace the {{hash}} with actual URL, the * Angular has a chance to replace the `{{hash}}` markup with its
* link will be broken and will most likely return a 404 error. * value. Until Angular replaces the markup the link will be broken
* and will most likely return a 404 error.
*
* The `ngHref` directive solves this problem. * The `ngHref` directive solves this problem.
* *
* The buggy way to write it: * The wrong way to write it:
* <pre> * <pre>
* <a href="http://www.gravatar.com/avatar/{{hash}}"/> * <a href="http://www.gravatar.com/avatar/{{hash}}"/>
* </pre> * </pre>
@ -26,7 +28,8 @@
* @param {template} ngHref any string which can contain `{{}}` markup. * @param {template} ngHref any string which can contain `{{}}` markup.
* *
* @example * @example
* This example uses `link` variable inside `href` attribute: * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes
* in links and their different behaviors:
<doc:example> <doc:example>
<doc:source> <doc:source>
<input ng-model="value" /><br /> <input ng-model="value" /><br />