Chapter 17Angular Directives

This chapter continues our exploration of Angular’s core principles. Specifically, this chapter focuses on directives, which are what allow Angular to extend HTML syntax. Angular ships with a number of built-in directives, but developers can also define custom directives to suit their application’s needs. This chapter will explain how to use directives, as well as how you can create your own.

Overview

Let’s begin by defining exactly what is a directive. According to the official documentation:

At a high level, directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS’s HTML compiler ($compile) to attach a specified behavior to that DOM element or even transform ...

Get Full Stack JavaScript Development With MEAN now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.