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

Arrow left icon
Profile Icon Vinci J Rufus
Arrow right icon
zł39.99 zł177.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (7 Ratings)
eBook Aug 2014 300 pages 1st Edition
eBook
zł39.99 zł177.99
Paperback
zł221.99
Subscription
Free Trial
Arrow left icon
Profile Icon Vinci J Rufus
Arrow right icon
zł39.99 zł177.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3 (7 Ratings)
eBook Aug 2014 300 pages 1st Edition
eBook
zł39.99 zł177.99
Paperback
zł221.99
Subscription
Free Trial
eBook
zł39.99 zł177.99
Paperback
zł221.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
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

Billing Address

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

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 : 9781783285624
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
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

Billing Address

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.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
$199.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 zł20 each
Feature tick icon Exclusive print discounts
$279.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 zł20 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 443.98
AngularJS Web Application Development Blueprints
zł221.99
AngularJS Web application development Cookbook
zł221.99
Total 443.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

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.