Latest web development tutorials

AngularJS ng-href command

AngularJS Reference Manual AngularJS Reference Manual


AngularJS examples

Use AngularJS setting add a link:

<Div ng-init = "myVar = 'http://www.w3big.com'">
<H1> This tutorial </ h1>
<P> visit <a ng-href = "{ {myVar}}"> {{myVar}} </ a> to learn! </ P>
</ Div>

try it"

Definition and Usage

ng-href instruction covers native <a> elements href attribute.

If there AngularJS code href value, you need to useng-href instead of href.

ng-href command to ensure that the link is normal, even before AngularJS code execution click on the link.


grammar

<A ng-href = "string "> </ a>

<a> elements support this instruction.


Parameter Value

value description
expression Results of the string expression

AngularJS Reference Manual AngularJS Reference Manual