Single Page Application using AngularJS
Madhuri A. Jadhav
#1
, Balkrishna R. Sawant
#2
, Anushree Deshmukh
*3
#
Master of Computer Application
Lokmanya Tilak College of Engineering
Koparkhairane, Navi Mumbai
*
Department of Computer Engineering
Lokmanya Tilak College of Engineering
Koparkhairane, Navi Mumbai
Abstract— Single Page Application (SPA) is composed of
individual component that can be replaced or updated
independently, without refreshing whole page so that the
entire page does not need to be reloaded on each user action,
which saves bandwidth as well as no loading of external files
every time when page is loaded, such as images or CSS files,
etc. The purpose behind this is to make the subsequent page
loads very fast as compared to traditional Request-Response
cycle. SPA's written by using JavaScript, HTML5, AJAX are
getting the likes of developers to build their web applications
and some frameworks like AngularJS which are built on top
of the JavaScript are making the life of developers very easy.
The idea behind using AngularJS in web application is to
make your web application modular and easy to maintain.
AngularJS brings MVC (Model View Controller) capability to
your application. After using minified and compressed files in
your application, the size reduces to some KBs which will
results in faster loading of pages.
Keywords— Single Page Applic
ation, AngularJS, Web Application.
I. INTRODUCTION
The traditional websites which were introduced in early
days of Internet had the sheer purpose of serving static
pages (content) to its client, which included content like
images, CSS, JavaScript, etc. as the years went people
started using websites to publish their business and explore
it to world, by the introduction of e-commerce, the need of
providing current status of business did rise and that
requirement lead to serving the dynamic pages which were
the mirror image of live status of business. Technologies
like Asynchronous JavaScript and XML (AJAX) were used
to dynamically load the data from database. AJAX helped
to introduce dynamic content to web pages, However, using
AJAX we can built desktop applications, So to achieve
same user experience on mobile applications, Single Page
Application have been developed. We can build Single
Page Application with JavaScript too, but development and
maintenance of front end using JavaScript is more complex.
Frontends with AngularJS is easy to develop and maintain,
since AngularJS frontend is broken down into 3
components Model, View and Controller (MVC).
In the traditional approach, when user dose any
interaction with a page, like button click then new page is
loaded and generated from scratch to display a response on
user’s window. This requires more bandwidth as well as
time.
In modern era of web technology most of the websites
are using SPA which is a web application that sits on one
single page like any other desktop application. In SPA all
the component like CSS, images, scripts and any other
required resources are loaded at one time at the initial page
load and then appropriate content/components gets loaded
dynamically depending on the user interaction. Once the
user has loaded an initial slim version, after that every
subsequent request will take very less amount of time
because it is now refreshing that particular part or region of
a page rather than reloading an entire page. The control
remains on one page till the user is on that website and that
single page communicate with the server behind the curtain.
II. S
INGLE PAGE APPLICATION (SPA)
The SPA is a web application that fully loads all of the
resources in initial request and then the page components
are replaced by other component depending on user
interaction. When we compare SPA with traditional web
application, we can see there exist an analogy between
‘states’ of SPA and ‘web pages’, navigation of ‘web
pages’ in traditional web application is analogous to ‘state’
navigation in SPA.
A. Definition
“Single Page Application (SPA) is composed of
individual components that can be replaced/updated
independently, without refreshing/reloading whole page so
that the entire page needs not to be reloaded on every user
action.”
1)
Individual Components: Entire page is divided into
smaller components that interact with each other.
2) Replaced/Updated: A component/region/part of a
page
replaced/updated with any changes on user requests.
3) Refreshing/Reloading:
The entire page never
reloaded/refreshed, rather new content is loaded in some
part or section as per new data.
4) User actions: Single Page Application is responsible
for handling all user inter actions such as button click, input
from keyboard etc. very fast and hence leads to very fluid
user interface.
SPA allows more flexible and elegant way of dealing
with data. Refreshing particular part or a section of a page
without refreshing an entire page is main goal that SPA is
Madhuri A. Jadhav et al, / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 6 (3) , 2015, 2876-2879