Book Image

Mastering AngularJS Directives

By : Josh Kurz
Book Image

Mastering AngularJS Directives

By: Josh Kurz

Overview of this book

<p>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.<br /><br />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.</p>
Table of Contents (16 chapters)
Mastering AngularJS Directives
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
The Tools of the Trade
Index

Optimization of the directives


User experience in an application is one of the biggest factors, if not the biggest, to its overall grade. No application should ever be given a passing grade if it is not responsive and has a sluggish feel to it. A JavaScript application has the chance to be on either ends of the speed spectrum because of the wide range of implementation options. There can be more than a few potential bottlenecks in a JavaScript application, and even more in an AngularJS application, which should be noted and approached correctly.

The biggest issue with any AngularJS application that uses the 1.2.0 and above branch is the digest cycle.

The digest cycle is an AngularJS-specific issue and is the cause of most speed-related issues. This is because of the thread-blocking nature of the working of the digest cycle and the issues when working with a lot of data.

Tools for monitoring performance

There are multiple monitoring tools available in each browser that we can take advantage of...