What this book covers
Throughout this book, we'll explore different ways to build AngularJS directives and understand all the elements that make up a directive.
We will cover fundamental concepts about scope, link, $compile, external templates, reusable components, and Directives Unit Testing.
Mastering how to create and customize AngularJS directives, by the end of this book you will be able to work comfortably with modular AngularJS applications using custom directives to create rich web interface components.
Although some points are advanced, you'll be prepared to understand the core concepts and how to choose or create the right directive for your project.
Chapter 1, Dealing with Modal and Tabs Directives, presents some alternatives to create simple interface components such as Modal and tabs using tips and exploring best practices to cover the most important points of creating and dealing with directives.
Chapter 2, Building a Navbar Custom Directive, focuses on building a custom navbar with menu links as a directive component. You will learn how to manipulate the DOM to show and hide user information using these custom directives and how to structure an AngularJS application to use shared components.
Chapter 3, Customizing and Using Bootstrap UI Directives, throws light on Bootstrap UI directives and explains how to extend and customize some components, exploring external templates and custom CSS customization, showing some component examples in real-case scenarios.
Chapter 4, Creating Interactive jQuery UI Directives, explains how to use jQuery and the jQuery UI to build some interface components with a comprehensive approach to how jQuery manipulates the DOM in AngularJS applications using IDs and selectors.
Chapter 5, Implementing Custom Directives with Yeoman Generators, shows how to use a Yeoman generator to create custom directives of ongoing projects, how to implement some useful directives, such as ngMap, and more.
Chapter 6, Using Directives to Develop Interface Components, demonstrates how to build a micro e-commerce application combining different types of custom directives.
Chapter 7, Building Directives with Dynamic Templates, explains how to build directives to use and load dynamic templates, provides a comparison of inline templates and external templates, explains more about the Compile function, and shows how to organize custom directives on shared folders.
Chapter 8, Creating Reusable Directives, shows how we can organize an AngularJS application and prepare it to be scalable with the use of shared directives, how to build chart directives, and explores some points about naming conventions, code organization, and best practices.
Chapter 9, Directive Unit Testing with Karma and Jasmine, covers how to configure and use Karma and Karma Runner to test custom directives using the Jasmine framework and explains how to deal with scope change and testing elements.