Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
AngularJS Web Application Development Blueprints
AngularJS Web Application Development Blueprints

AngularJS Web Application Development Blueprints: A practical guide to developing powerful web applications with AngularJS

eBook
€8.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

AngularJS Web Application Development Blueprints

Chapter 2. Setting Up Your Rig

I'm sure you would have heard the saying, "A tool man is known by the tools he keeps." OK fine, I just made that up, but that's actually true, especially when it comes to programming. Sure you can build complete and fully functional AngularJS apps just using a simple text editor and a browser, but if you want to work like a ninja, then make sure that you start using some of these tools as a part of your development workflow.

Do note that these tools are not mandatory to build AngularJS apps. Their use is recommended mainly to help improve the productivity.

In this chapter, we will see how to set up and use the following productivity tools:

  • Node.js
  • Grunt
  • Yeoman
  • Karma
  • Protractor

Since most of us are running a Mac, Windows, Ubuntu, or another flavor of the Linux operating system, we'll be covering the deployment steps common for all of them.

Setting up Node.js

Depending on your technology stack, I strongly recommend you have either Ruby or Node.js installed.

In case of AngularJS, most of the productivity tools or plugins are available as Node Package Manager (npm), and, hence, we will be setting up Node.js along with npm. Node.js is an open source JavaScript-based platform that uses an event-based Input/output model, making it lightweight and fast.

Let us head over to www.nodejs.org and install Node.js. Choose the right version as per your operating system.

The current version of Node.js at the time of writing this book is v0.10.x which comes with npm built in, making it a breeze to set up Node.js and npm.

Tip

Node.js doesn't come with a Graphical User Interface (GUI), so to use Node.js, you will need to open up your terminal and start firing some commands. Now would also be a good time to brush up on your DOS and Unix/Linux commands.

After installing Node.js, the first thing you'd want to check is to see if Node.js has...

Setting up Grunt

Grunt is a JavaScript-based task runner. It is primarily used for automating tasks such as running unit tests, concatenating, merging, and minifying JS and CSS files. You can also run shell commands. This makes it super easy to perform server cleanups and deploy code. Essentially, Grunt is to JavaScript what Rake would be to Ruby or Ant/Maven would be to Java.

Installing Grunt-cli

Installing Grunt-cli is slightly different from installing other Node.js modules. We first need to install the Grunt's Command Line Interface (CLI) by firing the following command in the terminal:

npm install -g grunt-cli

Mac or Linux users can also directly run the following command:

sudo npm install –g grunt-cli

Make sure you have administrative privileges. Use sudo if you are on a Mac or Linux system. If you are on Windows, right-click and open the command prompt with administrative rights. An important thing to note is that installing Grunt-cli doesn't automatically install Grunt...

Yeoman – the workflow tool

Yeoman prefers to be known as a workflow rather than just a tool. It is actually a collection of three tools that help you manage your workflow efficiently. The tools that come as a part of Yeoman are as follows:

  • Yo: This is a scaffolding tool and using the numerous generators available, one can quickly create the skeleton of your project. Yo has a generator to build AngularJS apps and we will be using that later in this chapter.
  • Grunt: This is used to run the tasks that will help you preview, test, and build the app.
  • Bower: This is an ideal tool for dependency management. Yeoman uses it to automatically search and download the necessary scripts.

Let's go about installing Yeoman and playing around with it a bit.

Installing Yeoman

To install Yeoman, make sure you are running it with administrative privileges. Enter the following command in the terminal:

sudo npm install –g yo

Next, let's install the AngularJS generator using the following command...

Unit testing with Karma

Writing automated unit tests for your AngularJS app is one of the best practices, the AngularJS team has been strongly advocating this right from the start. Every sample code on the www.Angularjs.org site has automated test cases along with it.

Keeping in line with the same philosophy, Yeoman too bakes in some sample unit tests using Karma. While Yeoman would automatically install Karma and its dependencies, let us, nevertheless, make sure the following modules are present in the node_modules folder:

  • karma
  • karma-chrome-launcher
  • karma-jasmine

In case you don't find them in your node_modules folder, install them using the npm install command. Next, make sure your karma.conf.js file looks like the following:

module.exports = function(config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine'],
    files: [
  'bower_components/angular/angular.js',
  'bower_components/angular-mocks/angular-mocks.js',
  'bower_components...

Using Protractor for End-to-End tests

As we saw earlier with Karma, we can write unit tests that will make sure that our code in the controllers is working well; however, it would fall short if you wanted to run automated User Acceptance Tests (UAT) or run tests that simulate user-driven interactions with the browser. For running such tests, we'll need to use another new tool called Protractor.

Protractor replaces the earlier AngularJS scenarios as the default End-to-End testing framework for testing AngularJS apps.

Protractor runs on WebDriver.js, which in turn makes use of the Selenium Server. Selenium is one of the most popular browser-automation tools. In this section, we will see how to set up a standalone instance of Selenium Server, install Protractor, and run a default set of End-to-End tests with it.

Let's first install Protractor by running the following command in the terminal:

sudo npm install –g protractor

This will install Protractor globally.

Installing Selenium...

Summary

This completes our chapter on setting up your rig. We worked through quite a few tools, namely Node.js, Grunt, Yeoman, Karma, and Protractor. While I strongly recommend making use of all of them when you build your AngularJS projects, you may feel free to choose the ones that suit your project the best.

Another thing to note is that most of these tools such as Node.js, ExpressJS, and Grunt can be used for any non-AngularJS projects. So getting familiar with these tools is surely beneficial for all frontend developers.

In the next chapter, we are going to see how to quickly build a clickable prototype using Angular-UI.

Left arrow icon Right arrow icon

Description

If you are a web application developer interested in using AngularJS for a real-life project, then this book is for you. As a prerequisite, knowledge of JavaScript and HTML is expected, and a working knowledge of AngularJS is preferred.

What you will learn

  • Gain a powerful understanding of AngularJS and singlepage applications that you can apply to your own development projects
  • Explore AngularJS directives feature and write your own custom directives
  • Build complete and professional applications ranging from social media and mobile web applications to CMS and an ecommerce store
  • Discover strategies and techniques for harnessing REST web services and Facebook APIs in your applications
  • Deploy applications using the highly scalable Amazon Web Services cloud solution
  • Develop rapid prototypes to create an impressive UI using Bootstrap's grid system
  • Get to grips with MEAN web development and create a CMS with a MEAN stack
Estimated delivery fee Deliver to Estonia

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 25, 2014
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781783285617
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Estonia

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

Publication date : Aug 25, 2014
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781783285617
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 83.98
AngularJS Web Application Development Blueprints
€41.99
AngularJS Web application development Cookbook
€41.99
Total 83.98 Stars icon
Banner background image

Table of Contents

11 Chapters
1. Introduction to AngularJS and the Single Page Application Chevron down icon Chevron up icon
2. Setting Up Your Rig Chevron down icon Chevron up icon
3. Rapid Prototyping with AngularJS Chevron down icon Chevron up icon
4. Using REST Web Services in Your AngularJS App Chevron down icon Chevron up icon
5. Facebook Friends' Birthday Reminder App Chevron down icon Chevron up icon
6. Building an Expense Manager Mobile App Chevron down icon Chevron up icon
7. Building a CMS on the MEAN Stack Chevron down icon Chevron up icon
8. Scalable Architecture for Deployments on AWS Chevron down icon Chevron up icon
9. Building an E-Commerce Store Chevron down icon Chevron up icon
A. AngularJS Resources Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(7 Ratings)
5 star 71.4%
4 star 14.3%
3 star 0%
2 star 0%
1 star 14.3%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Sep 26, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I thought the book was well written and very practical. I have not tried any of the code but will do so and will modify my review if I find it to be problematic to use. I have read most of the other angularjs books at the time of this review and was surprised with this one, because most of the others are substantially more abstract and in similar ways. I found this book to be refreshing in how it explains steps to be taken toward building a diverse group of applications with diverse functionality. I found the authors reliance on Yeoman to be a problem because I have had problems with it and prefer other methods. Yeoman is the main reason that I haven't used any of the code yet. I should get around to trying the code soon.
Amazon Verified review Amazon
T. Powell Mar 23, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I'm still new at learning JavaScript, JavaScript libraries, scaffolding tools, and so on. This is one of the best books I have read. When I focused on the MEAN stack (MongoDB, Express, AngularJS, and Node), I read Haviv's " MEAN Web Development ," by the same publisher. Haviv's book is thorough and informative in its own right; however, I realized I needed to understand AngularJS better.Rufus's book brought up to speed on AngularJS pretty quickly. For example, the "Setting up your rig" chapter was very helpful (a lot of other books assume you already know this--but I'm still getting started and didn't know what would be helpful in the AngularJS world). The example apps Rufus shows how to build incorporate a good spectrum of bells and whistles--and weren't too much over my head. The icing on the cake for me was the MEAN app project that Rufus presents toward the end of the book.
Amazon Verified review Amazon
Sascha Aug 31, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Super zu lesen, Beispiele sehr ausführlich erklärt. Mal was anderes, für mich mehr als brauchbar. Würde es wieder kaufen!Im großen und ganzen: Empfehlenswert!
Amazon Verified review Amazon
A J Oct 26, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I had just started working on a new project involving Node and AngularJS, that’s when I stumbled upon this book. This book is quite different from the others that I’ve read so far. It takes a practical approach to explaining the various concepts in Angular making it very easy to understand and follow. The book has quite a few useful examples like integrating facebook with your app, using Angular UI, switching the routing between Node and Angular, using Interceptors etc. all of which came in quite handy while working on my project.What I really liked about this book is that it goes beyond just Angular and covers other allied skillsets like CSS theming, optimizing your page load times and deploying apps on AWS. It would have been good to see examples of how to deploy to other cloud platforms like Google App Engine, Heroku or Digital Ocean.
Amazon Verified review Amazon
Tushar Kapila Feb 13, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good buy. Read it and used it as a reference in the last 4 weeks. Invaluable in getting my project out in time. CMS with Node, mongo Angualr exactly what I needed! Ch 9 AWS ecom web app with img upload & save to my dynamo db from Javascript ... wow
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela