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

Summary


AngularJS has integrated a seamless animation library into its core. The ability to separate all animation logic from individual directives is very orthogonal and nonevasive. All animations in AngularJS are based around CSS classes. The two main types of animations that can be achieved are as follows:

  • CSS-based animations

  • JavaScript-based animations

Each of these types of animations has their own specific use case. CSS animations are best used for simple, data-driven animations that need to offer fast-appealing transitions. JavaScript animations are best for more advanced types of animations. These advanced animations work seamlessly with animation factory functions.

To support animations in an AngularJS application, all that is needed is the ngAnimate module and custom animation declarations. These declarations can either be placed in JavaScript or CSS. This allows for a very nice decoupling between DOM and animation logic.