Deep dive into Angular.js directives
Deep dive into Angular.js directives
About the Book
BOOK IS NOW FREE. IT IS A BIT OUTDATED (1.4.X) AND DOESN'T COME WITH NEW COMPONENTS. IT IS STILL AN AWESOME WAY TO LEARNING DIRECTIVES THO. ENJOY IT.
Are you an Angular.js developer who wishes to learn more about directives? You came to the right place. You just need to know the basic pieces of Angular.js. Here I explain directives from zero.
Directive is what makes Angular the best Javascript framework out there, but it is also the most complicated concept of it. Directives are complex, there are infinite use cases for them and you can easily find yourself deep into different options, and not being sure of which one you need to apply to succeed.
So if directives seemed magical to you and you need to learn how they work to be able to create your own, this is the book you want.
In this book, you will learn:
- How directives are built.
- How to use all the different options on the directive definition object.
- How to apply some tips and tricks to make your directives more flexible.
- How to combine our directives with ng-model to create outstanding directives.
- How to create custom validations for our use case.
- How to wrap jQuery plugins into directives.
And much more!
The book comes with an introduction to Javascript unit testing as well as Angular unit testing.
All the examples of the books contains unit tests, all those tests are fully explained and you can try both working and test versions on Plunker.
Table of Contents
-
- Preface
-
I Unit test primer
- 1. What is unit testing and why should I care?
- 2. Introduction to Jasmine
- 3. Spies on Jasmine
- 4. Jasmine’s custom matchers
- 5. Testing Angular.js
-
II Directive Definition Object - Part 1
- 6. Introduction
- 7. Template
- 8. Restrict
- 9. Link function
-
10. Scope
- 10.1 Same Scope
- 10.2 New Scope
- 10.3 Isolated Scope
-
11. Transclusion
- 11.1 transclude: true
- 11.2 Transcluding by hand
- 11.3 Tranclusion and its scope
- 11.4 Transclude ‘element’
-
III Directives Lifecycle
- 12. Templates revisited
- 13. Compile
-
14. Controller
- 14.1 Controller As
- 14.2 Swapping controllers
- 15. Pre and post link
-
IV Directive Definition Object - Part 2
- 16. Priority
- 17. Terminal
- 18. Require
- 19. Multi Element
-
V Advanced usages
- 20. Observing attributes
- 21. Optional attributes
- 22. Manual $compile
- 23. Dynamic templates
- 24. Wrapping a jQuery plugin
-
Appendix A - Using ngModelController
- Local validation
- Remote validation
- Formatters and Parsers
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them