O'Reilly logo

Mastering Web Application Development with AngularJS by Pawel Kozlowski, Peter Bacon Darwin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Routing-specific patterns, tips, and tricks

The earlier sections of this chapter gave us a good overview of the AngularJS APIs, related to handling navigation in single-page web applications. Here we are going to see practical examples of using those APIs, and discuss the best related practices.

Handling links

The HTML anchor tag (a) is a primary tool for creating navigation links. AngularJS has special treatment for those links and the following subsections will guide through AngularJS specifics.

Creating clickable links

AngularJS comes pre-bundled with the a directive, which prevents default actions on links when the href attribute is omitted. This allows us to create clickable elements using the a tag and the ng-click directive. For example, we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required