128
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:
Next Topicangularjs-ng-if-directive