Visit {{myVar}} to learn!
Ng Ng Href
# AngularJS `ng-href` Directive
[ AngularJS Reference](#)
* * *
## AngularJS Example
Using AngularJS to set a link:
[Try it Β»](#)
* * *
## Definition and Usage
The **ng-href** directive overrides the native `` element's `href` attribute.
If the `href` value contains AngularJS code, you should use **ng-href** instead of **href**.
The `ng-href` directive ensures the link works correctly, even if clicked before AngularJS executes the code.
* * *
## Syntax
The `` element supports this directive.
* * *
## Parameter Values
| Value | Description |
| --- | --- |
| _expression_ | A string, the result of the expression's execution |
* * AngularJS Reference](#)
YouTip