Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

AngularJS a Directive


Example

The link inside the AngularJS application will not reload the page:

<a href="">Click me!</a>
<div ng-app="">
    <a href="">Click me too!</a>
</div>
Try it Yourself »

Definition and Usage

AngularJS modifies the default behavior of the <a> element.

AngularJS prevents the page from reloading when a user clicks on an <a> element with an empty href attribute.