Delving into AngularJS directives
Before we get started with building our application and integrating Facebook and all, let's first take a moment to learn about directives as we plan to integrate our Facebook authentication module as a directive.
What is a directive?
A directive is a marker on a DOM element that tells AngularJS to transform the DOM element or attach a specified behavior to it. The marker would be a CSS class, a custom attribute, or a custom element name.
AngularJS comes with a large set of predefined directives, many of which we've already been using till now. Some of the built-in directives that we've used so far are ng-app
, ng-repeat
, ng-model
, and ng-view
.
One of the coolest features of AngularJS is the ability to create your own custom directives that can be created once and used multiple times within your application.
Importance of naming conventions for directives
Directives need to follow a strict naming convention for them to work properly. This is because...