WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

AngularJS ng-href Directive


Example

Make a href utilizing AngularJS:

<div ng-init="myVar = 'http://www.welookups.com'">
    <h1>Tutorials</h1>
    <p>Go to <a ng-href="{{myVar}}">{{myVar}}</a> to learn!</p>
</div>
Try it yourself »

Definition and Usage

The ng-href order abrogates the first href property of a <a> element.

The ng-href order ought to be utilized rather than href in the event that you have AngularJS code inside the href value.

The ng-href mandate ensures the connection isn't made back the initial investment if the client taps the connection before AngularJS has assessed the code.


Syntax

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

Supported by the <a> element.


Parameter Values

Value Description
string A string esteem, or an articulation bringing about a string.