Free Sample
+ Collection

Mastering AngularJS Directives

Mastering
Josh Kurz

Develop, maintain, and test production-ready directives for any AngularJS-based application.
$25.99
$41.99
RRP $25.99
RRP $41.99
eBook
Print + eBook

Want this title & more?

$16.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781783981588
Paperback210 pages

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

Read More