Book Details

About This Book

Explore the options available for creating directives, by reviewing detailed explanations and real-world examples

Dissect the life cycle of a directive and understand why they are the base of the AngularJS framework

Discover how to create structured, maintainable, and testable directives through a step-by-step, hands-on approach to AngularJS

Who This Book Is For

Mastering AngularJS Directives is intended for developers who have experience with AngularJS and have a need for creating or customizing directives in any type of AngularJS application. This is a niche topic that focuses on very specific fundamental concepts of directive writing. This book is targeted at developers who have tried their hand at AngularJS, but would like to master it by learning how to make their own directives.

Table of Contents

Chapter 1: The Tools of the Trade

Introduction to directives

Summary

Chapter 2: Building a Stopwatch Directive

Breaking down the stopwatch

Writing the stopwatch

Summary

Chapter 3: Harnessing External JavaScript Libraries with Directives

Incorporating third-party libraries

Testing directives that use third-party libraries

Wrapping the gauge.js file

Wrapping the fullCalendar.js file

Summary

Chapter 4: Compiling the Advantages

Common use cases for compiling the DOM

Using transclusion in a directive

Creating recursive directives

Compiling templates and their many values

Introduction to the media player directive

Summary

Chapter 5: Communication between Directives

Testing integrated directives

Using scope objects for communication

How to use isolate scopes

Collaborating with controllers

Summary

Chapter 6: Working with Live Data

Techniques that drive directives

Directives can be in charge

Working with D3

Summary

Chapter 7: Optimization and Code Quality

AngularJS code quality

Optimization of the directives

Less bindings yield faster results

Summary

Chapter 8: Directives and Animations

Providing animations

CSS-based animations

JavaScript-based animations

Summary

Chapter 9: Conclusion

A directive's building blocks

Third-party libraries

The compile cycle

Testing directives

Directive intercommunication

Quality and performance

Animations

Summary

What You Will Learn

Master the ability to alter and transform DOM in an AngularJS context

Utilize and customize a directive that uses the core animation service

Incorporate any third-party library, with Angular Zen, which has a focus on advanced DOM manipulation

Discover the advantages of directives that yield the ability to compile dynamic templates

Understand every directive API option and their available uses

Find out how and why different types of tests are used on all types of directives

Optimize and enhance your application with custom directives

Explore what the future has in store for AngularJS directives and how it will tie into the present style of writing directives

In Detail

AngularJS offers many features that allow the creation of rich, compelling web applications. Directives are by far the most important feature to incorporate into any skill set. This book starts off by teaching basic and advanced techniques for the art of directive writing. The different techniques are taught by a series of examples that showcase when and why certain directives should be created, based on given use cases. It moves on to explain more about how to harness the potential of AngularJS, by incorporating external libraries, optimizing code, and using brand new functions such as animations.

Finally, the book includes an overview of the techniques and best practices that AngularJS developers need to keep in mind while developing their own applications. The overall goal of this book is to teach different aspects of directive writing that can be consumed by all levels.

Authors

Josh Kurz

Josh Kurz is a client-side technician who constantly pushes the realms of frontend technologies by mixing new-age theories and proven Computer Science concepts. He has successfully shown that AngularJS can be used to create some of the fastest, most usable data visualization applications while working at Turner. He also has a true passion for open source code and believes it is one of the reasons for his success. Currently, outside of work, he is practicing to become a black belt in Jiu Jitsu.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.