Javatpoint Logo
Javatpoint Logo

AngularJS ng-href Directive

The AngularJS ng-href directive provides a replacement for the original href attribute of an <a> element. You can use the ng-href directive instead of href if you have AngularJS code inside the href value.

The ng-href directive ensures that the link is not broken even if the user clicks the link beforethe code execution. It is supported by <a> element.

Syntax:

Parameter explanation:

string: It specifies a string value, or an expression resulting in a string.

Let's take an example to demonstrate the ng-href directive.

See this example:

Test it Now




Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA