Book Image

AngularJS UI Development

By : Amit Gharat, Matthias Nehlsen
Book Image

AngularJS UI Development

By: Amit Gharat, Matthias Nehlsen

Overview of this book

<p>AngularJS and its rich set of components solve many of the problems developers face when writing reliable single page applications in ways that would not be possible using other frameworks. This book will help you expand your horizons by teaching you the skills needed to successfully design, customize, build, and deliver real-world applications in AngularJS. We will start off by setting up a fully automated environment to quickly scaffold, test, and deploy any application. Along the way, we'll cover how to design and build production-ready applications to demonstrate how innovative and powerful AngularJS is. By leveraging CSS3 animations, we'll convert them into intuitive and native-like applications in no time. You will also learn how to use Grunt for application-specific task management, Bower to manage dependencies with external libraries/plugins, Git for better versioning, and Karma and Protractor for automated testing to build applications the way experts do.</p> <p>You will learn all this by building real-world applications including a to-do application, Github dashboard, project management application, and many more.</p>
Table of Contents (17 chapters)
AngularJS UI Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Installing Node.js and NPM


We will need to install a couple of additional tools to test and build our application. The foundation for this will be Node.js and NPM, the node package manager. Node.js is a platform built on top of V8, Google's JavaScript runtime, which is also used in Chrome. You can also build server-side, networked applications with Node.js, but here, it will only power our test and build the system. For now, think of it as a way to run the JavaScript code outside the browser. NPM is the package manager for Node.js, which makes it quite simple to install additional functionality. It comes bundled with Node.js.

The easiest way to install Node.js is to follow the instructions at http://nodejs.org.

OS X

On a Mac, you could either run the aforementioned installer or you could use Homebrew, a package manager for many open source libraries.

More information on Homebrew can be found at http://brew.sh/. Run the following command in the Terminal after installing Homebrew:

# brew install npm

The previous command will automatically install Node.js as a dependency of NPM if necessary.

Shell commands will run in a Terminal window. If you haven't used the Terminal before, go to the magnifying glass icon in the upper-right corner of your screen and type Terminal. You will need to open a new window after the installation is complete in order to run Node or NPM from a Terminal window.

Windows

On Windows, the easiest way to install Node.js is to run the Windows installer from http://nodejs.org. This installer, by default, now also installs NPM.

Command-line commands will run in the Windows command prompt. On Windows 7, this is available by clicking on the home button and entering cmd in the search box. You will need to open a new command-line window after the installation in order to be able to run Node or NPM from the command line.

Linux (Ubuntu)

On Ubuntu, there are two ways of installing Node and NPM, as follows:

  1. Preferred: download the source package from the Node.js web page and build it yourself (this may take a few minutes with a lot of output). This way, you are guaranteed to have the latest version. For this, perform the following steps:

    1. Uncompress the package.

    2. Open the folder in the Terminal.

    3. Inside the directory, run the following commands:

      	# ./configure
      	# make
      	# sudo make install  
      
    4. You may have to install G++ first:

      	# sudo apt-get install g++
      
  2. You can also install NPM through Ubuntu's package manager by running the following command in the Terminal:

    # sudo apt-get install npm
    

    This will install Node.js as a dependency of NPM as well. Afterwards, if you want to upgrade NPM itself, then run the following command:

    # sudo npm install –g npm
    

    While this approach works, you may get an outdated version; so, the first approach is generally recommended.