AngularJS Directives Cookbook
eBook - ePub

AngularJS Directives Cookbook

Fernando Monteiro

Share book
  1. 206 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

AngularJS Directives Cookbook

Fernando Monteiro

Book details
Book preview
Table of contents
Citations

About This Book

Extend the capabilities of AngularJS and build dynamic web applications by creating customized directives with this selection of more than 30 recipes

About This Book

  • Learn how to extend HTML templates in new ways to build even better web applications with exceptional interface components
  • Build reusable directives for large-scale AngularJS applications
  • Create even sophisticated and impressive modern web apps with ease

Who This Book Is For

This book is for developers with AngularJS experience who want to extend their knowledge to create or customize directives in any type of AngularJS application. Some experience of modern tools such as Yeoman and Bower would be helpful, but is not a requirement.

What You Will Learn

  • Build and customize external HTML templates, and create simple, effective directives for common interface components
  • Learn how to use Controller function and any Bootstrap UI directives to manipulate the DOM and how to transform any UI library into AngularJS directives
  • Construct an AngularJS application to use shared components and validate your HTML5
  • Discover how to use jQuery events and manipulate the DOM using jQuery UI inside AngularJS applications
  • Create custom directives for ongoing projects using Yeoman generators, and find out how to implement standalone directives
  • Build reusable directives for Large AngularJS applications and extend directives to use dynamic templates
  • Write unit test for directives using the Karma runner and Jasmine's behavior-driven development framework

In Detail

AngularJS directives are at the center of what makes it such an exciting ā€“ and important - web development framework. With directives, you can take greater control over HTML elements on your web pages ā€“ they ?irect' Angular's HTML compiler to behave in the way you want it to. It makes building modern web applications a much more expressive experience, and allows you to focus more closely on improving the way that user interaction impacts the DOM and the way your app manages data. If you're already using Angular, you probably recognize the power of directives to transform the way you understand and build your projects ā€“ but customizing and creating your own directives to harness AngularJS to its full potential can be more challenging. This cookbook shows you how to do just that ā€“ it's a valuable resource that demonstrates how to use directives at every stage in the workflow.

Packed with an extensive range of solutions and tips that AngularJS developers shouldn't do without, you'll find out how to make the most of directives. You'll find recipes demonstrating how to build a number of different user interface components with directives, so you can take complete control over how users interact with your application. You'll also learn how directives can simplify the way you work by creating reusable directives ā€“ by customizing them with Yeoman you can be confident that you're application has the robust architecture that forms the bedrock of the best user experiences. You'll also find recipes that will help you learn how to unit test directives, so you can be confident in the reliability and performance of your application.

Whether you're looking for guidance to dive deeper into AngularJS directives, or you want a reliable resource, relevant to today's web development challenges, AngularJS Directives Cookbook delivers everything you need in an easily accessible way.

Style and approach

This book easy-to-follow guide is packed with hands-on recipes to help you build modular AngularJS applications with custom directives. It presents tips on using the best tools and various ways to use these tools for front-end development.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is AngularJS Directives Cookbook an online PDF/ePUB?
Yes, you can access AngularJS Directives Cookbook by Fernando Monteiro in PDF and/or ePUB format, as well as other popular books in Informatique & Programmation en JavaScript. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781784395896

AngularJS Directives Cookbook


Table of Contents

AngularJS Directives Cookbook
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
Sections
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Dealing with Modal and Tabs Directives
Introduction
Using inline HTML templates
Getting ready
How to do itā€¦
How it worksā€¦
See also
Creating a simple modal directive
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Loading external templates for best practices
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Using the link function
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Dealing with tabs without Bootstrap UI directives
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
2. Building a Navbar Custom Directive
Introduction
Building a navbar directive
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Directory structure for common components
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Directive's controller function
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Using the data attribute to HTML5 compile
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
3. Customizing and Using Bootstrap UI Directives
Introduction
Dealing with modal directives
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Creating tab directives
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
The isolate $scope
Getting ready
How to do itā€¦
How it worksā€¦
Attribute
Bindings
Expressions
There's moreā€¦
See also
Building accordion tab directives
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Loading dynamic content
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
4. Creating Interactive jQuery UI Directives
Introduction
A simple directive example
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Manipulating the DOM with jQuery
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
The compile and link functions
Getting ready
How to do itā€¦
How it works...
There's moreā€¦
See also
Creating the jQuery UI draggable directive
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Creating the jQuery UI droppable directive
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
5. Implementing Custom Directives with Yeoman Generators
Introduction
Creating the baseline app with generator-angm
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Generator best practices
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
How to implement the ngMap directive
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Using the Angular-Loading-Bar directive
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Implementing the ng-grid directive
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
6. Using Directives to Develop Interface Components
Introduction
Creating an Off Canvas menu
Getting ready
How to do itā€¦
How it worksā€¦
See also
Applying custom CSS
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Building a shopping cart
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
7. Building Directives with Dynamic Templates
Introduction
Using dynamic templates on directives
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
The compile function
Getting ready
How to do itā€¦
How it worksā€¦
See also
Organizing dynamic directives on shared folders
Getting ready
How to do itā€¦
How it worksā€¦
Mixing different content on templates
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
8. Creating Reusable Directives
Introduction
How to scale an AngularJS project to use reusable directives
Getting ready
How to do itā€¦
How it worksā€¦
Building a directive as an interface component
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Creating a form directive with custom validation
Getting ready
How to do it...
How it worksā€¦
See also
9. Directive Unit Testing with Karma and Jasmine
Introduction
How to test AngularJS apps using Karma and Karma Runner
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Writing tests for directives with Jasmine
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Testing elements when the scope changes
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Index

AngularJS Directives Cookbook

Copyright Ā© 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused di...

Table of contents