SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Single Page Application
Single Page Applicationalso called SPA – is creating a
huge impact of web application development.This brings in lot of benefitto
web application development – since it brings in lot of features like
1. Componentbased development
2. Stateful development.
3. MVC creation using JavaScript tightly coupled.
4. Encapsulated with State data.
5. Operations/methodsare tightly bound to class.
A single-page application (SPA), also known as single-page interface
(SPI), is a web application or web site that fits on a single web page
with the goal of providing a more fluid user experience akin to a
desktop application.
In an SPA,either all necessary code – HTML, JavaScript, and CSS –
is retrieved with a single page load, or partial changes are performed
loading new code on demand from the web server, usually driven by
user actions. The page does not automatically reload during user
interaction with the application, nor does control transfer to another
page. Updates to the displayed page may or may not involve
interaction with a server.
As shown above in the picture one single web page which assembles the
components and it maintains the state. The current web sites switches between
different sites.
Write-only DOM. No state / data is read from the DOM. The application outputs
HTML and operations on elements, but nothing is ever read from the DOM. Storing
state in the DOM gets hard to manage very quickly: it is much better to have one
place where the data lives and to render the UI from the data, particularly when the
same data has to be shown in multiple places in the UI.
Models as the single source of truth. Instead of storing data in the DOM or in
random objects, there is a set of in-memory models which represent all of the
state/data in the application.
Views observe model changes. We want the views to reflect the content of the
models. When multiple views depend on a single model (e.g. when a model changes,
redraw these views), we don't want to manually keep track of each dependent view.
Instead of manually tracking things, there is a change event system through which
views receive change notifications from models and handle redrawing themselves.
Decoupled modules that expose small external surfaces. Instead of making
things global, we should try to create small subsystems that are not interdependent.
Dependencies make code hard to set up for testing. Small external surfaces make
refactoring internals easy, since most things can changes as long as the external
interface remains the same.
Minimizing DOM dependent-code. Why? Any code that depends on the DOM
needs to be tested for cross-browser compatibility. By writing code in a way that
isolates those nasty parts, a much more limited surface area needs to be tested for
cross-browser compatibility. Cross-browser incompatibilities are a lot more
manageable this way. Incompatibilities are in the DOM implementations, not in the
Javascript implementations, so it makes sense to minimize and isolate DOM -
dependent code
On a Single Page Application, the server-side will be responsible for:
 Handling CRUD (Create, Read, Update and Delete) operations
 Executing different operations and workflows (these may include changing states
of entities, updating database records)
 Authentication and Authorization (this should always be done on the server side
to ensure that the requests are legitimate)
 Validation of web requests
 Providing an interface for the client application to perform operations (typically
done via a REST API)
The client side will be responsible for:
 Populating and rendering the UI with proper data
 Access the server via AJAX
 Perform client side routing
 Perform client side validation
Angular JS this is one tool which helps in creating SPA application
 Data-binding: It is the automatic synchronization of data between model and view
components.
 Scope: These are objects that refer to the model. They act as a glue between controller
and view.
 Controller: These are Javascript functions that are bound to a particular scope.
 Services: AngularJS come with several built-in services for example $http to make a
XMLHttpRequests. These are singleton objects which are instantiated only once in app.
 Filters: These select a subset of items from an array and returns a new array.
 Directives: Directives are markers on DOM elements (such as elements, attributes, css,
and more). These can be used to create custom HTML tags that serve as new, custom
widgets. AngularJS has built-in directives (ngBind, ngModel...)
 Templates:These are the rendered view with information from the controller and model.
These can be a single file (like index.html) or multiple views in one page using "partials".
 Routing: It is concept of switching views.
 Model View Whatever: MVC is a design pattern for dividing an application into different
parts (called Model, View and Controller), each with distinct responsibilities. AngularJS
does not implement MVC in the traditional sense, but rather something closer to MVVM
(Model-View-ViewModel). The Angular JS team refers it humorously as Model View
Whatever.
 Deep Linking: Deep linking allows you to encode the state of application in the URL so
that it can be bookmarked. The application can then be restored from the URL to the same
state.
 Dependency Injection: AngularJS has a built-in dependency injection subsystem that
helps the developer by making the application easier to develop, understand, and test.
Advantages of AngularJS
 AngularJS provides capability to create Single Page Application in a very clean and
maintainable way.
 AngularJS provides data binding capability to HTML thus giving user a rich and responsive
experience
 AngularJS code is unit testable.
 AngularJS uses dependency injection and make use of separation of concerns.
 AngularJS provides reusable components.
 With AngularJS, developer write less code and get more functionality.
 In AngularJS, views are pure html pages, and controllers written in javascript do the
business processing.
On top of everything, AngularJS applications can run on all major browsers and smart phones
including Android and iOS based phones/tablets.
Sample Loading Stack on how the modules are getting loaded
All the specific functionalities are defined as modules in the system which
mostly representobjects – Apps.js
This does the routing part on click of what which module should be routed
will be handled by - States.js
The Screen representationwhich is Html definition of the screens will be
mentioned here.
Every html will be supported by one controller this controller provides the
supportive functionality for the screens.
The Associated data which is populated from the Mongo DB is essentially
pulled from Service.js this makes a remote call in pulling the data

Weitere ähnliche Inhalte

Was ist angesagt?

Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantNitin Sawant
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0Buu Nguyen
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines Dev Raj Gautam
 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and conceptsSuresh Patidar
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 
MVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,MobileMVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,Mobilenaral
 
Building Web Application Using Spring Framework
Building Web Application Using Spring FrameworkBuilding Web Application Using Spring Framework
Building Web Application Using Spring FrameworkEdureka!
 
Modern webtechnologies
Modern webtechnologiesModern webtechnologies
Modern webtechnologiesBesjan Xhika
 
JSF 2.3: Integration with Front-End Frameworks
JSF 2.3: Integration with Front-End FrameworksJSF 2.3: Integration with Front-End Frameworks
JSF 2.3: Integration with Front-End FrameworksIan Hlavats
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCBarry Gervin
 
Mvc 4 0_jayant_jindal_28082010
Mvc 4 0_jayant_jindal_28082010Mvc 4 0_jayant_jindal_28082010
Mvc 4 0_jayant_jindal_28082010Rishu Mehra
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.Ni
 
Model view controller (mvc)
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)M Ahsan Khan
 

Was ist angesagt? (20)

Asp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin SawantAsp.net mvc presentation by Nitin Sawant
Asp.net mvc presentation by Nitin Sawant
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
 
New Features of ASP.NET 4.0
New Features of ASP.NET 4.0New Features of ASP.NET 4.0
New Features of ASP.NET 4.0
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines
 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and concepts
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
MVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,MobileMVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,Mobile
 
Building Web Application Using Spring Framework
Building Web Application Using Spring FrameworkBuilding Web Application Using Spring Framework
Building Web Application Using Spring Framework
 
What's new in Angular 2?
What's new in Angular 2?What's new in Angular 2?
What's new in Angular 2?
 
Modern webtechnologies
Modern webtechnologiesModern webtechnologies
Modern webtechnologies
 
Angular js
Angular jsAngular js
Angular js
 
JSF 2.3: Integration with Front-End Frameworks
JSF 2.3: Integration with Front-End FrameworksJSF 2.3: Integration with Front-End Frameworks
JSF 2.3: Integration with Front-End Frameworks
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
Mvc 4 0_jayant_jindal_28082010
Mvc 4 0_jayant_jindal_28082010Mvc 4 0_jayant_jindal_28082010
Mvc 4 0_jayant_jindal_28082010
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
MVC
MVCMVC
MVC
 
Model view controller (mvc)
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)
 

Andere mochten auch

Italia, coasta
Italia, coastaItalia, coasta
Italia, coastasokoban
 
Catch the moment (new ones!)
Catch the moment (new ones!)Catch the moment (new ones!)
Catch the moment (new ones!)sokoban
 
Media And Money
Media And MoneyMedia And Money
Media And MoneyJohn Healy
 
instant foto
instant fotoinstant foto
instant fotosokoban
 
Cause Marketing - A Journey
Cause Marketing - A JourneyCause Marketing - A Journey
Cause Marketing - A JourneyJohn Healy
 
Dubai..pps
Dubai..ppsDubai..pps
Dubai..ppssokoban
 
Valencia - orasul artelor si a stiintei
Valencia - orasul artelor si a stiinteiValencia - orasul artelor si a stiintei
Valencia - orasul artelor si a stiinteisokoban
 
Orasul fara strazi din Olanda
Orasul fara strazi din OlandaOrasul fara strazi din Olanda
Orasul fara strazi din Olandasokoban
 
Arte latinoamericano
Arte latinoamericanoArte latinoamericano
Arte latinoamericanojuan paez
 
What gets into Software code after some time
What gets into Software code  after some timeWhat gets into Software code  after some time
What gets into Software code after some timePrasad Narasimhan
 
Funny accidents
Funny accidentsFunny accidents
Funny accidentssokoban
 
Copyright Review Workshop Uct April 2008
Copyright Review Workshop   Uct April 2008Copyright Review Workshop   Uct April 2008
Copyright Review Workshop Uct April 2008Paul Jacobson
 
Html5 (looks ready for everything)
Html5 (looks ready for  everything)Html5 (looks ready for  everything)
Html5 (looks ready for everything)Prasad Narasimhan
 

Andere mochten auch (20)

Italia, coasta
Italia, coastaItalia, coasta
Italia, coasta
 
Catch the moment (new ones!)
Catch the moment (new ones!)Catch the moment (new ones!)
Catch the moment (new ones!)
 
Media And Money
Media And MoneyMedia And Money
Media And Money
 
instant foto
instant fotoinstant foto
instant foto
 
Cause Marketing - A Journey
Cause Marketing - A JourneyCause Marketing - A Journey
Cause Marketing - A Journey
 
The classroom of the future is virtual
The classroom of the future is virtualThe classroom of the future is virtual
The classroom of the future is virtual
 
Think before you click
Think before you clickThink before you click
Think before you click
 
Biblioteche di ateneo e Iris
Biblioteche di ateneo e IrisBiblioteche di ateneo e Iris
Biblioteche di ateneo e Iris
 
Unicasorienta 2012
Unicasorienta 2012Unicasorienta 2012
Unicasorienta 2012
 
Dubai..pps
Dubai..ppsDubai..pps
Dubai..pps
 
Valencia - orasul artelor si a stiintei
Valencia - orasul artelor si a stiinteiValencia - orasul artelor si a stiintei
Valencia - orasul artelor si a stiintei
 
Jisc rsc morris_2012
Jisc rsc morris_2012Jisc rsc morris_2012
Jisc rsc morris_2012
 
Orasul fara strazi din Olanda
Orasul fara strazi din OlandaOrasul fara strazi din Olanda
Orasul fara strazi din Olanda
 
Soa
SoaSoa
Soa
 
Arte latinoamericano
Arte latinoamericanoArte latinoamericano
Arte latinoamericano
 
What gets into Software code after some time
What gets into Software code  after some timeWhat gets into Software code  after some time
What gets into Software code after some time
 
Expo Milano 2015
Expo Milano 2015Expo Milano 2015
Expo Milano 2015
 
Funny accidents
Funny accidentsFunny accidents
Funny accidents
 
Copyright Review Workshop Uct April 2008
Copyright Review Workshop   Uct April 2008Copyright Review Workshop   Uct April 2008
Copyright Review Workshop Uct April 2008
 
Html5 (looks ready for everything)
Html5 (looks ready for  everything)Html5 (looks ready for  everything)
Html5 (looks ready for everything)
 

Ähnlich wie Single Page Application

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to AngularjsGaurav Agrawal
 
angularjs_tutorial.docx
angularjs_tutorial.docxangularjs_tutorial.docx
angularjs_tutorial.docxtelegramvip
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionOleksii Prohonnyi
 
Components of a Generic Web Application Architecture
Components of  a Generic Web Application ArchitectureComponents of  a Generic Web Application Architecture
Components of a Generic Web Application ArchitectureMadonnaLamin1
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarAppfinz Technologies
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular jsAayush Shrestha
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxsarah david
 
Angular webinar - Credo Systemz
Angular webinar - Credo SystemzAngular webinar - Credo Systemz
Angular webinar - Credo SystemzTraining Institute
 
Comparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdfComparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdfStephieJohn
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js SimplifiedSunil Yadav
 
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescriptangularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescriptCuneiform Consulting Pvt Ltd.
 
The Growing Popularity of AngularJS
The Growing Popularity of AngularJSThe Growing Popularity of AngularJS
The Growing Popularity of AngularJSWhiz Solutions
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questionscodeandyou forums
 

Ähnlich wie Single Page Application (20)

Angular introduction basic
Angular introduction basicAngular introduction basic
Angular introduction basic
 
What is mean stack?
What is mean stack?What is mean stack?
What is mean stack?
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Angular js introduction
Angular js introductionAngular js introduction
Angular js introduction
 
Training On Angular Js
Training On Angular JsTraining On Angular Js
Training On Angular Js
 
angularjs_tutorial.docx
angularjs_tutorial.docxangularjs_tutorial.docx
angularjs_tutorial.docx
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: Introduction
 
Components of a Generic Web Application Architecture
Components of  a Generic Web Application ArchitectureComponents of  a Generic Web Application Architecture
Components of a Generic Web Application Architecture
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumar
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
 
Angular webinar - Credo Systemz
Angular webinar - Credo SystemzAngular webinar - Credo Systemz
Angular webinar - Credo Systemz
 
Comparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdfComparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdf
 
Top 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web DevelopmentTop 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web Development
 
AngularJS
AngularJSAngularJS
AngularJS
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
 
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescriptangularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
 
The Growing Popularity of AngularJS
The Growing Popularity of AngularJSThe Growing Popularity of AngularJS
The Growing Popularity of AngularJS
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questions
 

Mehr von Prasad Narasimhan

Technology needs to be disruptive
Technology needs to be disruptiveTechnology needs to be disruptive
Technology needs to be disruptivePrasad Narasimhan
 
Data visualization representation of Analytics data
Data visualization representation of Analytics  dataData visualization representation of Analytics  data
Data visualization representation of Analytics dataPrasad Narasimhan
 
Art of creating good software
Art of creating good softwareArt of creating good software
Art of creating good softwarePrasad Narasimhan
 
Internet of things & predictive analytics
Internet of things & predictive analyticsInternet of things & predictive analytics
Internet of things & predictive analyticsPrasad Narasimhan
 
Application of predictive analytics
Application of predictive analyticsApplication of predictive analytics
Application of predictive analyticsPrasad Narasimhan
 
Software engineering at the speed of technology
Software engineering at the speed of technologySoftware engineering at the speed of technology
Software engineering at the speed of technologyPrasad Narasimhan
 
Challenges in adapting predictive analytics
Challenges  in  adapting  predictive  analyticsChallenges  in  adapting  predictive  analytics
Challenges in adapting predictive analyticsPrasad Narasimhan
 
Predictive analytics in marketing
Predictive analytics in marketingPredictive analytics in marketing
Predictive analytics in marketingPrasad Narasimhan
 
Predictive analytics in financial service
Predictive analytics in financial servicePredictive analytics in financial service
Predictive analytics in financial servicePrasad Narasimhan
 
Predictive analytics in health insurance
Predictive analytics in health insurancePredictive analytics in health insurance
Predictive analytics in health insurancePrasad Narasimhan
 
360 degree view of architect
360 degree view  of architect360 degree view  of architect
360 degree view of architectPrasad Narasimhan
 
Information + insight = action
Information + insight = actionInformation + insight = action
Information + insight = actionPrasad Narasimhan
 
Become a software technical architect
Become a software technical architectBecome a software technical architect
Become a software technical architectPrasad Narasimhan
 
What is happening in Information Technology
What is happening in Information TechnologyWhat is happening in Information Technology
What is happening in Information TechnologyPrasad Narasimhan
 

Mehr von Prasad Narasimhan (20)

Analytics
AnalyticsAnalytics
Analytics
 
Technology needs to be disruptive
Technology needs to be disruptiveTechnology needs to be disruptive
Technology needs to be disruptive
 
Riseof technology
Riseof technologyRiseof technology
Riseof technology
 
Information as commodity
Information as commodityInformation as commodity
Information as commodity
 
Data visualization representation of Analytics data
Data visualization representation of Analytics  dataData visualization representation of Analytics  data
Data visualization representation of Analytics data
 
Art of creating good software
Art of creating good softwareArt of creating good software
Art of creating good software
 
Internet of things & predictive analytics
Internet of things & predictive analyticsInternet of things & predictive analytics
Internet of things & predictive analytics
 
Application of predictive analytics
Application of predictive analyticsApplication of predictive analytics
Application of predictive analytics
 
Software engineering at the speed of technology
Software engineering at the speed of technologySoftware engineering at the speed of technology
Software engineering at the speed of technology
 
Challenges in adapting predictive analytics
Challenges  in  adapting  predictive  analyticsChallenges  in  adapting  predictive  analytics
Challenges in adapting predictive analytics
 
Predictive analytics in marketing
Predictive analytics in marketingPredictive analytics in marketing
Predictive analytics in marketing
 
Predictive analytics in financial service
Predictive analytics in financial servicePredictive analytics in financial service
Predictive analytics in financial service
 
Predictive analytics in health insurance
Predictive analytics in health insurancePredictive analytics in health insurance
Predictive analytics in health insurance
 
3D printing
3D printing3D printing
3D printing
 
Internet of things
Internet of thingsInternet of things
Internet of things
 
360 degree view of architect
360 degree view  of architect360 degree view  of architect
360 degree view of architect
 
Where business meet’s IT
Where business meet’s ITWhere business meet’s IT
Where business meet’s IT
 
Information + insight = action
Information + insight = actionInformation + insight = action
Information + insight = action
 
Become a software technical architect
Become a software technical architectBecome a software technical architect
Become a software technical architect
 
What is happening in Information Technology
What is happening in Information TechnologyWhat is happening in Information Technology
What is happening in Information Technology
 

Single Page Application

  • 1. Single Page Application Single Page Applicationalso called SPA – is creating a huge impact of web application development.This brings in lot of benefitto web application development – since it brings in lot of features like 1. Componentbased development 2. Stateful development. 3. MVC creation using JavaScript tightly coupled. 4. Encapsulated with State data. 5. Operations/methodsare tightly bound to class. A single-page application (SPA), also known as single-page interface (SPI), is a web application or web site that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application. In an SPA,either all necessary code – HTML, JavaScript, and CSS – is retrieved with a single page load, or partial changes are performed loading new code on demand from the web server, usually driven by user actions. The page does not automatically reload during user interaction with the application, nor does control transfer to another page. Updates to the displayed page may or may not involve interaction with a server.
  • 2. As shown above in the picture one single web page which assembles the components and it maintains the state. The current web sites switches between different sites. Write-only DOM. No state / data is read from the DOM. The application outputs HTML and operations on elements, but nothing is ever read from the DOM. Storing
  • 3. state in the DOM gets hard to manage very quickly: it is much better to have one place where the data lives and to render the UI from the data, particularly when the same data has to be shown in multiple places in the UI. Models as the single source of truth. Instead of storing data in the DOM or in random objects, there is a set of in-memory models which represent all of the state/data in the application. Views observe model changes. We want the views to reflect the content of the models. When multiple views depend on a single model (e.g. when a model changes, redraw these views), we don't want to manually keep track of each dependent view. Instead of manually tracking things, there is a change event system through which views receive change notifications from models and handle redrawing themselves. Decoupled modules that expose small external surfaces. Instead of making things global, we should try to create small subsystems that are not interdependent. Dependencies make code hard to set up for testing. Small external surfaces make refactoring internals easy, since most things can changes as long as the external interface remains the same. Minimizing DOM dependent-code. Why? Any code that depends on the DOM needs to be tested for cross-browser compatibility. By writing code in a way that isolates those nasty parts, a much more limited surface area needs to be tested for cross-browser compatibility. Cross-browser incompatibilities are a lot more manageable this way. Incompatibilities are in the DOM implementations, not in the Javascript implementations, so it makes sense to minimize and isolate DOM - dependent code On a Single Page Application, the server-side will be responsible for:  Handling CRUD (Create, Read, Update and Delete) operations
  • 4.  Executing different operations and workflows (these may include changing states of entities, updating database records)  Authentication and Authorization (this should always be done on the server side to ensure that the requests are legitimate)  Validation of web requests  Providing an interface for the client application to perform operations (typically done via a REST API) The client side will be responsible for:  Populating and rendering the UI with proper data  Access the server via AJAX  Perform client side routing  Perform client side validation Angular JS this is one tool which helps in creating SPA application
  • 5.  Data-binding: It is the automatic synchronization of data between model and view components.  Scope: These are objects that refer to the model. They act as a glue between controller and view.  Controller: These are Javascript functions that are bound to a particular scope.  Services: AngularJS come with several built-in services for example $http to make a XMLHttpRequests. These are singleton objects which are instantiated only once in app.  Filters: These select a subset of items from an array and returns a new array.  Directives: Directives are markers on DOM elements (such as elements, attributes, css, and more). These can be used to create custom HTML tags that serve as new, custom widgets. AngularJS has built-in directives (ngBind, ngModel...)
  • 6.  Templates:These are the rendered view with information from the controller and model. These can be a single file (like index.html) or multiple views in one page using "partials".  Routing: It is concept of switching views.  Model View Whatever: MVC is a design pattern for dividing an application into different parts (called Model, View and Controller), each with distinct responsibilities. AngularJS does not implement MVC in the traditional sense, but rather something closer to MVVM (Model-View-ViewModel). The Angular JS team refers it humorously as Model View Whatever.  Deep Linking: Deep linking allows you to encode the state of application in the URL so that it can be bookmarked. The application can then be restored from the URL to the same state.  Dependency Injection: AngularJS has a built-in dependency injection subsystem that helps the developer by making the application easier to develop, understand, and test. Advantages of AngularJS  AngularJS provides capability to create Single Page Application in a very clean and maintainable way.  AngularJS provides data binding capability to HTML thus giving user a rich and responsive experience  AngularJS code is unit testable.  AngularJS uses dependency injection and make use of separation of concerns.  AngularJS provides reusable components.  With AngularJS, developer write less code and get more functionality.  In AngularJS, views are pure html pages, and controllers written in javascript do the business processing. On top of everything, AngularJS applications can run on all major browsers and smart phones including Android and iOS based phones/tablets.
  • 7. Sample Loading Stack on how the modules are getting loaded All the specific functionalities are defined as modules in the system which mostly representobjects – Apps.js This does the routing part on click of what which module should be routed will be handled by - States.js The Screen representationwhich is Html definition of the screens will be mentioned here. Every html will be supported by one controller this controller provides the supportive functionality for the screens. The Associated data which is populated from the Mongo DB is essentially pulled from Service.js this makes a remote call in pulling the data