16.07.2017 Views

AngularJS Essentials

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Getting Started with <strong>AngularJS</strong><br />

The following diagram exhibits the interaction between the <strong>AngularJS</strong><br />

architecture components:<br />

Source: Official documentation (www.angularjs.org)<br />

Setting up the framework<br />

The configuration process is very simple and in order to set up the framework, we<br />

start by importing the angular.js script to our HTML file. After that, we need to<br />

create the application module by calling the module function from the Angular's API,<br />

with its name and dependencies.<br />

With the module already created, we just need to place the ng-app attribute with<br />

the module's name inside the html element or any other element that surrounds the<br />

application. This attribute is important because it supports the initialization process<br />

of the framework that we will study in the later chapters.<br />

In the following code, there is an introductory application about a parking<br />

lot. At first, we are able to add and also list the parked cars, storing its plate in<br />

memory. Throughout the book, we will evolve this parking control application by<br />

incorporating each newly studied concept.<br />

[ 10 ]<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!