Cover image for Mastering AngularJS Directives.
Mastering AngularJS Directives.
Title:
Mastering AngularJS Directives.
Author:
Kurz, Josh.
ISBN:
9781783981595
Personal Author:
Physical Description:
1 online resource (224 pages)
Contents:
Mastering AngularJS Directives -- Table of Contents -- Mastering AngularJS Directives -- Credits -- About the Author -- About the Reviewers -- www.PacktPub.com -- Support files, eBooks, discount offers, and more -- Why subscribe? -- Free access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 1. The Tools of the Trade -- Introduction to directives -- Directive Definition Object API -- Priority -- Terminal -- Scope -- Controller -- Require -- ControllerAs -- Restrict -- Template -- TemplateUrl -- Replace -- Transclude -- Compile -- Link -- Wrapping up definition objects -- Summary -- 2. Building a Stopwatch Directive -- Breaking down the stopwatch -- Stopwatch requirements -- The basics of testing -- Creation tests -- Writing the stopwatch -- Stopwatch's business logic -- Business logic tests -- Optimizing the stopwatch -- Stopwatch's filter -- Summary -- 3. Harnessing External JavaScript Libraries with Directives -- Incorporating third-party libraries -- Testing directives that use third-party libraries -- Wrapping the gauge.js file -- Testing the gauge directive -- Writing the gauge directive -- Writing scope interaction tests -- Wrapping the fullCalendar.js file -- Introduction to the calendar directive -- Testing the fullCalendar directive -- Testing the calendar's initialization and MVC functionality -- Writing the fullCalendar directive -- Summary -- 4. Compiling the Advantages -- Common use cases for compiling the DOM -- Using transclusion in a directive -- Unveiling transclusion -- Creating recursive directives -- The custom recursive tree directive -- Using transclusion and a templateUrl with the treeNode directive -- Testing the treeNode directive.

The treeNodeTemplate directive -- The treeNode directive using only transclusion -- Testing the treeNode directive -- The treenodeNoTemplate directive -- Compiling templates and their many values -- Introduction to the media player directive -- Requirements for the media player directive -- Testing the media player directive -- Writing the media player directive -- Breaking down the media player directive -- Utilizing advanced templates -- The mediaelement templates -- The flowplayer templates -- Summary -- 5. Communication between Directives -- Testing integrated directives -- Integration tests -- Using scope objects for communication -- Using child scopes -- Creating a wasFast directive -- Unit testing -- Integration tests -- Implementing the wasFast directive -- Creating a fastRunner directive -- Integration testing -- Implementing the fastRunner directive -- How to use isolate scopes -- Relying on the rootScope function -- Broadcasting to other directives -- Communicating with media players -- Integration testing for the bbBroadcastingPlayer directive -- Implementing the bbBroadcastPlayer directive -- Collaborating with controllers -- Requiring the basics -- Using controllers for the bbPlayer directive -- Integration testing -- Implementing the bbPlayer and bbPlayerContainer directives -- Creating a fastClicker directive -- Integration testing -- Writing the fastClicker directive -- Wiring up the stopwatch -- Summary -- 6. Working with Live Data -- Techniques that drive directives -- The q library -- How should data be watched for changes? -- Doing a deep watch on rootScope.data -- Doing a shallow watch on rootScope.data -- Directives can be in charge -- Testing directives that control data -- Testing bbPhoneDetails -- Writing the bbPhoneDetails directive -- Working with D3 -- The YouTube views bar chart -- E2E tests for bbBarChart.

The stockTicker directive -- E2E tests for bbStockChart -- Summary -- 7. Optimization and Code Quality -- AngularJS code quality -- The importance of templates -- Necessary DOM manipulations -- Optimization of the directives -- Tools for monitoring performance -- The digest cycle -- Less bindings yield faster results -- Solving the problem with the bbOneBinders directive -- The bbOneBinders directive -- The bbOneBinders tests -- Summary -- 8. Directives and Animations -- Providing animations -- CSS-based animations -- Working with ngClass and transitions -- Working with ngClass and animations -- Working with ngIf and transitions -- JavaScript-based animations -- Custom effeckt.CSS animations -- Summary -- 9. Conclusion -- A directive's building blocks -- Third-party libraries -- The compile cycle -- Testing directives -- Directive intercommunication -- Quality and performance -- Animations -- Summary -- Index.
Abstract:
This book takes a hands-on, step-by-step approach that helps the reader focus on the most important points and learn exactly what they need. All of the directives in the book have live examples that go along with them, and there is a strong focus on how tests are incorporated into all types of directives. 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.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: