SlideShare a Scribd company logo
AngularJS Project Setup
A Step-by-Step Guide
Presented by: Gourav Ajmani
Technical Lead, RapidValue Solutions
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 2
Contents
Introduction.....................................................................................................................................................................3
Install Pre-requisites .........................................................................................................................................................3
Install the Yeoman Toolset ................................................................................................................................................5
Install a Yeoman Generator ..............................................................................................................................................5
AngularJS-RequireJS Generator .........................................................................................................................................6
Start Preparing to Create Project ......................................................................................................................................6
Configure your Generator.................................................................................................................................................6
Review the Yeoman-generated Application.........................................................................................................................8
Run the Application in the Browser ..................................................................................................................................10
Making the Application Perfect and De-coupled ................................................................................................................12
Conclusion .....................................................................................................................................................................14
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 3
Introduction
AngularJS is a popular JavaScript framework. It is intended to make the implementation of RIA
(Rich Internet Applications) easier and convenient. AngularJS is created and maintained by
Google. It is relatively, a new JavaScript framework, which is designed to make the front-end
development as simple as possible. AngularJS is a useful tool for standardizing the web
application structure and it provides a future template to ensure that the client-side
applications are developed much effectively.
I have been working on AngularJS for a while now, and have read many tutorials and blogs on it.
I could never find any article which gives a clear, concise and step-by-step guide to create the
project structure and execute the project. So, I have written this document which will help you
to create the Project structure and then execute it in a simple manner.
Install Pre-requisites
Before installing Yeoman, you will need the following:
 Node.js v0.10.x+
o You can download it from here.
o Set the path to NodeJS in environment variable, in this example: NodeJS is
installed in “C:Program Files (x86)”. So, the path looks like :
 npm (which comes bundled with Node) v2.1.0+
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 4
 GIT
o You can download it from here.
o Set the path to GIT in environment variable. In this case, GTI got installed in
“C:Program Files”. So, the path looks like:
 Check if you have NodeJS and npm installed by typing (in command prompt):
 By default, npm comes along with NodeJS, but you might need to update it with the
latest version of it. You can update it using the command (in command prompt):
Check if you have GIT installed by typing (in command prompt):
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 5
Install the Yeoman Toolset
 Once you have NodeJS installed, install the Yeoman Toolset, by typing (in command
prompt):
It should execute/install some commands and you should be back to your command
prompt without any error.
 You should confirm whether all the required installation is completed , by typing (in
command prompt):
The above command should give you the three different versions of Yo, Bower, and
Grunt respectively.
Install Yeoman Generator
You will need to spend time setting up the code for your web application, creating folder
structure, defining and installing dependencies in traditional web development workflow. But,
if you have Yeoman, it makes the task easier. So, install it.
 Install a generator for AngularJS projects.
o You can install Yeoman generators, using the npm command.
o Install generator-angular by typing (in command prompt):
This should install NodeJS packages required for the generator.
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 6
AngularJS-RequireJS Generator
You should install generator for AngularJS-RequireJS and Karma-RequireJS.
 Install generator-angular-require and generator-karma-require.
o You can install generator for AngularJS-RequireJS & Karma-RequireJS by typing
(in command prompt)
It should execute/install some commands and you will get a command prompt without
any error.
Start Preparing to Create Project
 Make a new directory (name of your application) and navigate into it.
o A directory is created with the name “SampleAngularJsProject”, in local drive
“G:”, and navigated there using command prompt.
o Here, you need to execute Yo for angular-require along with appName.
(SampleAngularJsProject) by typing (in command prompt).
Type Y or n , depends on your choice, if you would like to share the usage
statistic of the tool. It is preferable not to do that, so n is typed.
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 7
Configure Your Generator
AngularJS generator provides an option to customize the application with the commonly
developed libraries, so that it can speed up the development environment.
Here, it gives an option to use Sass (with Compass) and include Twitter Bootstrap. In this,
Bootstrap is included and Sass is avoided. Enter n then y , respectively, to these options.
Generator will prompt to select the Angular Modules that you would like to include in the
application.
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 8
You can check/un-check the modules using UP / DOWN arrow key and use the SPACE bar to
select it.
Let’s go ahead with the default selected one (until you are keen to include the other two
modules)). Press Enter to see what Yeoman has in store for you.
It should execute/install some commands and you should be back to your command prompt
without any error.
Review the Yeoman-generated Application
Open up your “SampleAngularJsProject” directory to take a look at what was actually
scaffolded. It'll look like this:
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 9
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 10
In “SampleAngularJsProject”, we have:
 app: a parent directory for our application
 index.html: the base html file for our Angular application
 404.html, favicon.ico, and robots.txt: commonly used web files so you don’t have to
create them yourself
 scripts: JS files
 app.js: Entry point to Angular application code
 controllers: ngular controllers
 styles: CSS files
 views: directory for Angular templates
 bower_components, bower.json: our JavaScript/web dependencies, installed by Bower
 Gruntfile.js, package.json, and node_modules: configuration and dependencies
required by our Grunt tasks
 test: a scaffolded out test runner and the unit tests for the project, including boilerplate
tests for our controllers
Run the Application in the Browser
To run the application, you do not have to worry about setting up the web server locally. All of
it is considered by Yeoman.
 Start the server
o To start the server, run a grunt task to create local, node based HTTP server on
localhost:9090 by typing ( In command prompt):
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 11
And, your web browser should open up, automatically, and it should launch the newly created
AngularJS web application.
 Auto-reload the changes in your files
o Yeoman has generated an application for you in a way, so that if you make any
changes in any of your file it will, automatically, force a browser refresh.
o This is called live reloading.
o Live reload has been configured in the gruntfile.js and it keeps a watch on certain
set of files and it, automatically, reloads them if it detects any changes.
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 12
Making the Application Perfect and De-coupled
Yeoman has made it easy to create the Angularjs project structure and has given us an outline
and idea of how the structure should look.
However, there are few suggestions, which you might want to consider, which will make your
application more decoupled, maintainable and neat.
If you notice the project structure above, you will see “script” folder which has app.js and a
nested folder named “controllers”, which will store all the JS files of the application. There is
another folder named “views”, which is used to store all the html files of the application.
 This is the place where the changes need to be incorporated :
o Instead of saving all the application JS files in “controllers”, it is recommended to
create nested folder named “modules” under “scripts” and eliminate
“controllers” folder.
o Coming to “modules” folder, you should create the nested folder under
“modules”, depending on the Modules you have for the application. Login
module, for example.
o So, you create a folder named “login” under “modules”. In “login” folder, the
JS, HTML & CSS files are saved, corresponding to Login module.
By doing so, you can eliminate “views” folder as well, because, the HTML’s are
there in the corresponding module folder.
So, the updated code structure should look like.
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 13
If you notice, there is no “controllers” & “views” folder any more but couple of other
new folders, “modules”, “login” & “accounts”, each of which have their own JS, HTML
& CSS files.
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 14
Conclusion
AngularJS is a great option which enables you to extend HTML vocabulary for your application.
The environment, thus obtained, is expressive, easily readable, and fast to develop. AngularJS
is an essential toolset for building the framework which is most suited to application
development. It is fully extensible and works efficiently. You are able to modify each and every
feature or replace them to suit the needs and requirements of the development workflow.
AngularJS has been dominating JavaScript framework and the popularity, that it has gained,
reveals that the dominance will prevail in the future.
This document addresses queries on AngularJS and hope the information is useful for you.
Please feel free to post your queries, feedback, comments and suggestions at
contactus@rapidvaluesolutions.com
Reference
 AngulurJS - http://www.w3schools.com/angular/angular_intro.asp
 Yeoman toolset - https://github.com/yeoman/yo
 Yeoman Generator - http://yeoman.io/codelab/install-generators.html
 Controllers – http://www.w3schools.com/angular/angular_controllers.asp
 Modules – https://docs.angularjs.org/api/ng/function/angular.module
 Scripts - https://docs.angularjs.org/api/ng/directive/script
 HTML - http://www.w3schools.com/html/
 CSS - http://www.w3schools.com/css/
 NoodleJS - http://damodaran.github.io/Books/Nodejs/noodlejs.html
 Bower- https://github.com/angular/bower-angular
 Grunt - https://www.npmjs.com/package/grunt-angular-builder
 Node Js- http://www.tutorialspoint.com/nodejs/
 GIT – https://en.wikipedia.org/wiki/GitHub
 Npm - https://github.com/npm/npm
AngularJS Project Setup Step By Step Guide
© RapidValue Solutions 15
About RapidValue
RapidValue is a leading provider of end-to-end mobility, omni-channel and cloud solutions to enterprises
worldwide. Armed with a large team of experts in consulting, UX design and application engineering,
along with experience delivering global projects, we offer a range of services across various industry
verticals. RapidValue delivers its services to the world’s top brands and Fortune 1000 companies, and
has offices in the United States and India.
Disclaimer:
This document contains information that is confidential and proprietary to RapidValue Solutions Inc. No part of it may be used,
circulated, quoted, or reproduced for distribution outside RapidValue. If you are not the intended recipient of this report, you are
hereby notified that the use, circulation, quoting, or reproducing of this report is strictly prohibited and may be unlawful.
© RapidValue Solutions
www.rapidvaluesolutions.com/blogwww.rapidvaluesolutions.com
+1 877.643.1850 contactus@rapidvaluesolutions.com
Ad

Recommended

A gently introduction to AngularJS
A gently introduction to AngularJS
Gregor Woiwode
 
AngularJs Crash Course
AngularJs Crash Course
Keith Bloomfield
 
Angular js
Angular js
Behind D Walls
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
AngularJS Best Practices
AngularJS Best Practices
Betclic Everest Group Tech Team
 
AngularJS Framework
AngularJS Framework
Barcamp Saigon
 
AngularJS application architecture
AngularJS application architecture
Gabriele Falace
 
AngularJs presentation
AngularJs presentation
Phan Tuan
 
AngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UX
JWORKS powered by Ordina
 
AngularJS for designers and developers
AngularJS for designers and developers
Kai Koenig
 
Introduction to Unit Tests and TDD
Introduction to Unit Tests and TDD
Betclic Everest Group Tech Team
 
AngularJS introduction
AngularJS introduction
Tania Gonzales
 
Introduction to Angularjs
Introduction to Angularjs
Manish Shekhawat
 
AngularJS Basic Training
AngularJS Basic Training
Cornel Stefanache
 
Angular js
Angular js
Dinusha Nandika
 
AngularJs
AngularJs
syam kumar kk
 
AngularJS best-practices
AngularJS best-practices
Henry Tao
 
Why angular js Framework
Why angular js Framework
Sakthi Bro
 
Practical AngularJS
Practical AngularJS
Wei Ru
 
AngularJS Best Practices
AngularJS Best Practices
Narek Mamikonyan
 
Introduction to AngularJS
Introduction to AngularJS
Jussi Pohjolainen
 
Angular js
Angular js
Knoldus Inc.
 
Angular js
Angular js
Manav Prasad
 
Understanding angular js
Understanding angular js
Aayush Shrestha
 
Angular from Scratch
Angular from Scratch
Christian Lilley
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
Gabi Costel Lapusneanu
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
Front end development with Angular JS
Front end development with Angular JS
Bipin
 
AngularJS Architecture
AngularJS Architecture
Eyal Vardi
 
AngularJS Basics with Example
AngularJS Basics with Example
Sergey Bolshchikov
 

More Related Content

What's hot (20)

AngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UX
JWORKS powered by Ordina
 
AngularJS for designers and developers
AngularJS for designers and developers
Kai Koenig
 
Introduction to Unit Tests and TDD
Introduction to Unit Tests and TDD
Betclic Everest Group Tech Team
 
AngularJS introduction
AngularJS introduction
Tania Gonzales
 
Introduction to Angularjs
Introduction to Angularjs
Manish Shekhawat
 
AngularJS Basic Training
AngularJS Basic Training
Cornel Stefanache
 
Angular js
Angular js
Dinusha Nandika
 
AngularJs
AngularJs
syam kumar kk
 
AngularJS best-practices
AngularJS best-practices
Henry Tao
 
Why angular js Framework
Why angular js Framework
Sakthi Bro
 
Practical AngularJS
Practical AngularJS
Wei Ru
 
AngularJS Best Practices
AngularJS Best Practices
Narek Mamikonyan
 
Introduction to AngularJS
Introduction to AngularJS
Jussi Pohjolainen
 
Angular js
Angular js
Knoldus Inc.
 
Angular js
Angular js
Manav Prasad
 
Understanding angular js
Understanding angular js
Aayush Shrestha
 
Angular from Scratch
Angular from Scratch
Christian Lilley
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
Gabi Costel Lapusneanu
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
Front end development with Angular JS
Front end development with Angular JS
Bipin
 
AngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UX
JWORKS powered by Ordina
 
AngularJS for designers and developers
AngularJS for designers and developers
Kai Koenig
 
AngularJS introduction
AngularJS introduction
Tania Gonzales
 
AngularJS best-practices
AngularJS best-practices
Henry Tao
 
Why angular js Framework
Why angular js Framework
Sakthi Bro
 
Practical AngularJS
Practical AngularJS
Wei Ru
 
Understanding angular js
Understanding angular js
Aayush Shrestha
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
Front end development with Angular JS
Front end development with Angular JS
Bipin
 

Viewers also liked (19)

AngularJS Architecture
AngularJS Architecture
Eyal Vardi
 
AngularJS Basics with Example
AngularJS Basics with Example
Sergey Bolshchikov
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
M R Rony
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
Arc & Codementor
 
Overview about AngularJS Framework
Overview about AngularJS Framework
Camilo Lopes
 
Google cloud endpoints
Google cloud endpoints
Dimitar Danailov
 
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Roman Kirillov
 
Building ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS Applications
ColdFusionConference
 
VMworld Europe 2014: Preview the Latest Release from AirWatch
VMworld Europe 2014: Preview the Latest Release from AirWatch
VMworld
 
Building single page applications
Building single page applications
SC5.io
 
Introduction To Single Page Application
Introduction To Single Page Application
KMS Technology
 
Enterprise Mobile Device Management (MDM)
Enterprise Mobile Device Management (MDM)
SPEC INDIA
 
MDM- Mobile Device Management
MDM- Mobile Device Management
Bala G
 
AngularJS - Présentation (french)
AngularJS - Présentation (french)
Yacine Rezgui
 
Allegro PCB教學
Allegro PCB教學
Michael Lee
 
Mobile device management presentation
Mobile device management presentation
ratneshsinghparihar
 
blood, blood product, blood transfusion
blood, blood product, blood transfusion
Hidayat Shariff
 
DepED Master Teacher I and II
DepED Master Teacher I and II
joems_angel2000
 
The Main and Subordinate Clause
The Main and Subordinate Clause
Rachel Jones
 
AngularJS Architecture
AngularJS Architecture
Eyal Vardi
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
M R Rony
 
29 Essential AngularJS Interview Questions
29 Essential AngularJS Interview Questions
Arc & Codementor
 
Overview about AngularJS Framework
Overview about AngularJS Framework
Camilo Lopes
 
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Google Cloud Endpoints: Building Third-Party APIs on Google AppEngine
Roman Kirillov
 
Building ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS Applications
ColdFusionConference
 
VMworld Europe 2014: Preview the Latest Release from AirWatch
VMworld Europe 2014: Preview the Latest Release from AirWatch
VMworld
 
Building single page applications
Building single page applications
SC5.io
 
Introduction To Single Page Application
Introduction To Single Page Application
KMS Technology
 
Enterprise Mobile Device Management (MDM)
Enterprise Mobile Device Management (MDM)
SPEC INDIA
 
MDM- Mobile Device Management
MDM- Mobile Device Management
Bala G
 
AngularJS - Présentation (french)
AngularJS - Présentation (french)
Yacine Rezgui
 
Allegro PCB教學
Allegro PCB教學
Michael Lee
 
Mobile device management presentation
Mobile device management presentation
ratneshsinghparihar
 
blood, blood product, blood transfusion
blood, blood product, blood transfusion
Hidayat Shariff
 
DepED Master Teacher I and II
DepED Master Teacher I and II
joems_angel2000
 
The Main and Subordinate Clause
The Main and Subordinate Clause
Rachel Jones
 
Ad

Similar to AngularJS Project Setup step-by- step guide - RapidValue Solutions (20)

Bootstrapping angular js with bower grunt yeoman
Bootstrapping angular js with bower grunt yeoman
Makarand Bhatambarekar
 
AngularJs
AngularJs
Abdhesh Kumar
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01
Arunangsu Sahu
 
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
kiciunonge
 
angular
angular
MUDDUKRISHNA14
 
angular
angular
MUDDUKRISHNA14
 
angular
angular
MUDDUKRISHNA14
 
Angular
Angular
MUDDUKRISHNA14
 
angular content
angular content
MUDDUKRISHNA14
 
angularjs_tutorial.docx
angularjs_tutorial.docx
telegramvip
 
Angular js book
Angular js book
Kamlesh Singh
 
Angularjs
Angularjs
Heinrrich Facho
 
Angularjs
Angularjs
Mustafa Juma
 
Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
FITC
 
Intro to AngularJS
Intro to AngularJS
Timea Turdean
 
AngularJS Training Course in Delhi
AngularJS Training Course in Delhi
APTRON
 
Angular js workshop
Angular js workshop
Rolands Krumbergs
 
Angular kickstart slideshare
Angular kickstart slideshare
SaleemMalik52
 
Getting started with angular js
Getting started with angular js
Maurice De Beijer [MVP]
 
Angular patterns
Angular patterns
Premkumar M
 
Bootstrapping angular js with bower grunt yeoman
Bootstrapping angular js with bower grunt yeoman
Makarand Bhatambarekar
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01
Arunangsu Sahu
 
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
kiciunonge
 
angularjs_tutorial.docx
angularjs_tutorial.docx
telegramvip
 
Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
FITC
 
AngularJS Training Course in Delhi
AngularJS Training Course in Delhi
APTRON
 
Angular kickstart slideshare
Angular kickstart slideshare
SaleemMalik52
 
Angular patterns
Angular patterns
Premkumar M
 
Ad

More from RapidValue (20)

How to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-Spa
RapidValue
 
Play with Jenkins Pipeline
Play with Jenkins Pipeline
RapidValue
 
Accessibility Testing using Axe
Accessibility Testing using Axe
RapidValue
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in Kotlin
RapidValue
 
Automation in Digital Cloud Labs
Automation in Digital Cloud Labs
RapidValue
 
Microservices Architecture - Top Trends & Key Business Benefits
Microservices Architecture - Top Trends & Key Business Benefits
RapidValue
 
Uploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADI
RapidValue
 
Appium Automation with Kotlin
Appium Automation with Kotlin
RapidValue
 
Build UI of the Future with React 360
Build UI of the Future with React 360
RapidValue
 
Python Google Cloud Function with CORS
Python Google Cloud Function with CORS
RapidValue
 
Real-time Automation Result in Slack Channel
Real-time Automation Result in Slack Channel
RapidValue
 
Automation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDD
RapidValue
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
RapidValue
 
Video Recording of Selenium Automation Flows
Video Recording of Selenium Automation Flows
RapidValue
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeter
RapidValue
 
Migration to Extent Report 4
Migration to Extent Report 4
RapidValue
 
The Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QA
RapidValue
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
RapidValue
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon Studio
RapidValue
 
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using Valgrind
RapidValue
 
How to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-Spa
RapidValue
 
Play with Jenkins Pipeline
Play with Jenkins Pipeline
RapidValue
 
Accessibility Testing using Axe
Accessibility Testing using Axe
RapidValue
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in Kotlin
RapidValue
 
Automation in Digital Cloud Labs
Automation in Digital Cloud Labs
RapidValue
 
Microservices Architecture - Top Trends & Key Business Benefits
Microservices Architecture - Top Trends & Key Business Benefits
RapidValue
 
Uploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADI
RapidValue
 
Appium Automation with Kotlin
Appium Automation with Kotlin
RapidValue
 
Build UI of the Future with React 360
Build UI of the Future with React 360
RapidValue
 
Python Google Cloud Function with CORS
Python Google Cloud Function with CORS
RapidValue
 
Real-time Automation Result in Slack Channel
Real-time Automation Result in Slack Channel
RapidValue
 
Automation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDD
RapidValue
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
RapidValue
 
Video Recording of Selenium Automation Flows
Video Recording of Selenium Automation Flows
RapidValue
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeter
RapidValue
 
Migration to Extent Report 4
Migration to Extent Report 4
RapidValue
 
The Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QA
RapidValue
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
RapidValue
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon Studio
RapidValue
 
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using Valgrind
RapidValue
 

Recently uploaded (20)

Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
Python Conference Singapore - 19 Jun 2025
Python Conference Singapore - 19 Jun 2025
ninefyi
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Using the SQLExecutor for Data Quality Management: aka One man's love for the...
Safe Software
 
Mastering AI Workflows with FME by Mark Döring
Mastering AI Workflows with FME by Mark Döring
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 

AngularJS Project Setup step-by- step guide - RapidValue Solutions

  • 1. AngularJS Project Setup A Step-by-Step Guide Presented by: Gourav Ajmani Technical Lead, RapidValue Solutions
  • 2. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 2 Contents Introduction.....................................................................................................................................................................3 Install Pre-requisites .........................................................................................................................................................3 Install the Yeoman Toolset ................................................................................................................................................5 Install a Yeoman Generator ..............................................................................................................................................5 AngularJS-RequireJS Generator .........................................................................................................................................6 Start Preparing to Create Project ......................................................................................................................................6 Configure your Generator.................................................................................................................................................6 Review the Yeoman-generated Application.........................................................................................................................8 Run the Application in the Browser ..................................................................................................................................10 Making the Application Perfect and De-coupled ................................................................................................................12 Conclusion .....................................................................................................................................................................14
  • 3. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 3 Introduction AngularJS is a popular JavaScript framework. It is intended to make the implementation of RIA (Rich Internet Applications) easier and convenient. AngularJS is created and maintained by Google. It is relatively, a new JavaScript framework, which is designed to make the front-end development as simple as possible. AngularJS is a useful tool for standardizing the web application structure and it provides a future template to ensure that the client-side applications are developed much effectively. I have been working on AngularJS for a while now, and have read many tutorials and blogs on it. I could never find any article which gives a clear, concise and step-by-step guide to create the project structure and execute the project. So, I have written this document which will help you to create the Project structure and then execute it in a simple manner. Install Pre-requisites Before installing Yeoman, you will need the following:  Node.js v0.10.x+ o You can download it from here. o Set the path to NodeJS in environment variable, in this example: NodeJS is installed in “C:Program Files (x86)”. So, the path looks like :  npm (which comes bundled with Node) v2.1.0+
  • 4. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 4  GIT o You can download it from here. o Set the path to GIT in environment variable. In this case, GTI got installed in “C:Program Files”. So, the path looks like:  Check if you have NodeJS and npm installed by typing (in command prompt):  By default, npm comes along with NodeJS, but you might need to update it with the latest version of it. You can update it using the command (in command prompt): Check if you have GIT installed by typing (in command prompt):
  • 5. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 5 Install the Yeoman Toolset  Once you have NodeJS installed, install the Yeoman Toolset, by typing (in command prompt): It should execute/install some commands and you should be back to your command prompt without any error.  You should confirm whether all the required installation is completed , by typing (in command prompt): The above command should give you the three different versions of Yo, Bower, and Grunt respectively. Install Yeoman Generator You will need to spend time setting up the code for your web application, creating folder structure, defining and installing dependencies in traditional web development workflow. But, if you have Yeoman, it makes the task easier. So, install it.  Install a generator for AngularJS projects. o You can install Yeoman generators, using the npm command. o Install generator-angular by typing (in command prompt): This should install NodeJS packages required for the generator.
  • 6. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 6 AngularJS-RequireJS Generator You should install generator for AngularJS-RequireJS and Karma-RequireJS.  Install generator-angular-require and generator-karma-require. o You can install generator for AngularJS-RequireJS & Karma-RequireJS by typing (in command prompt) It should execute/install some commands and you will get a command prompt without any error. Start Preparing to Create Project  Make a new directory (name of your application) and navigate into it. o A directory is created with the name “SampleAngularJsProject”, in local drive “G:”, and navigated there using command prompt. o Here, you need to execute Yo for angular-require along with appName. (SampleAngularJsProject) by typing (in command prompt). Type Y or n , depends on your choice, if you would like to share the usage statistic of the tool. It is preferable not to do that, so n is typed.
  • 7. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 7 Configure Your Generator AngularJS generator provides an option to customize the application with the commonly developed libraries, so that it can speed up the development environment. Here, it gives an option to use Sass (with Compass) and include Twitter Bootstrap. In this, Bootstrap is included and Sass is avoided. Enter n then y , respectively, to these options. Generator will prompt to select the Angular Modules that you would like to include in the application.
  • 8. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 8 You can check/un-check the modules using UP / DOWN arrow key and use the SPACE bar to select it. Let’s go ahead with the default selected one (until you are keen to include the other two modules)). Press Enter to see what Yeoman has in store for you. It should execute/install some commands and you should be back to your command prompt without any error. Review the Yeoman-generated Application Open up your “SampleAngularJsProject” directory to take a look at what was actually scaffolded. It'll look like this:
  • 9. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 9
  • 10. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 10 In “SampleAngularJsProject”, we have:  app: a parent directory for our application  index.html: the base html file for our Angular application  404.html, favicon.ico, and robots.txt: commonly used web files so you don’t have to create them yourself  scripts: JS files  app.js: Entry point to Angular application code  controllers: ngular controllers  styles: CSS files  views: directory for Angular templates  bower_components, bower.json: our JavaScript/web dependencies, installed by Bower  Gruntfile.js, package.json, and node_modules: configuration and dependencies required by our Grunt tasks  test: a scaffolded out test runner and the unit tests for the project, including boilerplate tests for our controllers Run the Application in the Browser To run the application, you do not have to worry about setting up the web server locally. All of it is considered by Yeoman.  Start the server o To start the server, run a grunt task to create local, node based HTTP server on localhost:9090 by typing ( In command prompt):
  • 11. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 11 And, your web browser should open up, automatically, and it should launch the newly created AngularJS web application.  Auto-reload the changes in your files o Yeoman has generated an application for you in a way, so that if you make any changes in any of your file it will, automatically, force a browser refresh. o This is called live reloading. o Live reload has been configured in the gruntfile.js and it keeps a watch on certain set of files and it, automatically, reloads them if it detects any changes.
  • 12. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 12 Making the Application Perfect and De-coupled Yeoman has made it easy to create the Angularjs project structure and has given us an outline and idea of how the structure should look. However, there are few suggestions, which you might want to consider, which will make your application more decoupled, maintainable and neat. If you notice the project structure above, you will see “script” folder which has app.js and a nested folder named “controllers”, which will store all the JS files of the application. There is another folder named “views”, which is used to store all the html files of the application.  This is the place where the changes need to be incorporated : o Instead of saving all the application JS files in “controllers”, it is recommended to create nested folder named “modules” under “scripts” and eliminate “controllers” folder. o Coming to “modules” folder, you should create the nested folder under “modules”, depending on the Modules you have for the application. Login module, for example. o So, you create a folder named “login” under “modules”. In “login” folder, the JS, HTML & CSS files are saved, corresponding to Login module. By doing so, you can eliminate “views” folder as well, because, the HTML’s are there in the corresponding module folder. So, the updated code structure should look like.
  • 13. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 13 If you notice, there is no “controllers” & “views” folder any more but couple of other new folders, “modules”, “login” & “accounts”, each of which have their own JS, HTML & CSS files.
  • 14. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 14 Conclusion AngularJS is a great option which enables you to extend HTML vocabulary for your application. The environment, thus obtained, is expressive, easily readable, and fast to develop. AngularJS is an essential toolset for building the framework which is most suited to application development. It is fully extensible and works efficiently. You are able to modify each and every feature or replace them to suit the needs and requirements of the development workflow. AngularJS has been dominating JavaScript framework and the popularity, that it has gained, reveals that the dominance will prevail in the future. This document addresses queries on AngularJS and hope the information is useful for you. Please feel free to post your queries, feedback, comments and suggestions at [email protected] Reference  AngulurJS - http://www.w3schools.com/angular/angular_intro.asp  Yeoman toolset - https://github.com/yeoman/yo  Yeoman Generator - http://yeoman.io/codelab/install-generators.html  Controllers – http://www.w3schools.com/angular/angular_controllers.asp  Modules – https://docs.angularjs.org/api/ng/function/angular.module  Scripts - https://docs.angularjs.org/api/ng/directive/script  HTML - http://www.w3schools.com/html/  CSS - http://www.w3schools.com/css/  NoodleJS - http://damodaran.github.io/Books/Nodejs/noodlejs.html  Bower- https://github.com/angular/bower-angular  Grunt - https://www.npmjs.com/package/grunt-angular-builder  Node Js- http://www.tutorialspoint.com/nodejs/  GIT – https://en.wikipedia.org/wiki/GitHub  Npm - https://github.com/npm/npm
  • 15. AngularJS Project Setup Step By Step Guide © RapidValue Solutions 15 About RapidValue RapidValue is a leading provider of end-to-end mobility, omni-channel and cloud solutions to enterprises worldwide. Armed with a large team of experts in consulting, UX design and application engineering, along with experience delivering global projects, we offer a range of services across various industry verticals. RapidValue delivers its services to the world’s top brands and Fortune 1000 companies, and has offices in the United States and India. Disclaimer: This document contains information that is confidential and proprietary to RapidValue Solutions Inc. No part of it may be used, circulated, quoted, or reproduced for distribution outside RapidValue. If you are not the intended recipient of this report, you are hereby notified that the use, circulation, quoting, or reproducing of this report is strictly prohibited and may be unlawful. © RapidValue Solutions www.rapidvaluesolutions.com/blogwww.rapidvaluesolutions.com +1 877.643.1850 [email protected]