Questions tagged [single-page-application]

A single-page application (SPA) is a web application that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application.

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.

Resources

5306 questions
52
votes
3 answers

Firebase hosting: How to prevent caching for the index.html of an SPA

I'm hosting an SPA on firebase where almost all paths get rewritten to index.html. I'm using webpack hash based cache busting, so I want to always prevent caching of my index.html but not any other files. I'm finding it surprisingly difficult to…
zevdg
  • 1,091
  • 2
  • 9
  • 20
51
votes
3 answers

Can one cache and secure a REST API with Cloudflare?

I am designing a RESTful API that is intended to be consumed by a single-page application and a native mobile app. Some calls of this API return public results that can be cached for a certain time. Moreover, there is a need for rate protection to…
flexponsive
  • 6,060
  • 8
  • 26
  • 41
48
votes
9 answers

Deploy single page application Angular: 404 Not Found nginx

I Have an Angular application. I run the command ng build --prod --aot to generate the dist folder. In the dist folder I created a file named Staticfile then I uploaded the dist folder to pivotal.io with the following commands: cf push name-app…
Melchia
  • 22,578
  • 22
  • 103
  • 117
48
votes
4 answers

How to Clear Contents of an observableArray That was Populated from Previous Visits to a View

I have a Single Page Application that uses knockout for the data binding. The CAApproval.html view in my single page application has an observeablearray named AllCertificates in the viewmodel code. It populates fine on the page. When you navigate…
Chris
  • 795
  • 2
  • 12
  • 27
47
votes
3 answers

How to integrate OAuth with a single page application?

When using OAuth (2) I need a redirection endpoint in my application that the OAuth-offering service can redirect to, once I have been authenticated. How do I handle this in a single page application? Of course, a redirect to the OAuth-offering…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
46
votes
1 answer

What is FormControl used for? Why is it used? How Should it be used?

Can someone explain to me in layman's terms what function FormControl serves, and why/how one would want to use it? I'm using Material-UI in React, and many of the form examples I see make use of FormControl, but I'm having a hard time understanding…
Cmaxster
  • 1,035
  • 2
  • 11
  • 18
46
votes
5 answers

Code splitting causes chunks to fail to load after new deployment for SPA

I have a single page app that I code split on each route. When I deploy a new version of my app the users will usually get an error if a user still has the page open and visits a route they haven't visited before. Another scenario where this can…
46
votes
3 answers

AngularJS HTML5 Mode - How do direct links work without server specific changes?

Note: This question could also read: How to support bookmarking of hashbang-less client side MVC frameworks in Java. I am transitioning an angular app that uses hashtags to one that is html5mode. I have successfully…
Robert Christian
  • 18,218
  • 20
  • 74
  • 89
45
votes
1 answer

Why do we need a Single Page Application?

The Single Page Application (SPA) has come to us. A lot of new things come with it as well, like Routing, Page life cycle at client side, MVC pattern, MVVM pattern, MV* pattern,... and some of Javascript patterns also come to us like AMD pattern,…
thangchung
  • 2,020
  • 2
  • 17
  • 28
43
votes
3 answers

Best practices for authentication and authorization in Angular without breaking RESTful principles?

I've read quite a few SO threads about authentication and authorization with REST and Angular, but I'm still not feeling like I have a great solution for what I'm hoping to do. For some background, I'm planning to building an app in AngularJS where…
austrum
  • 453
  • 1
  • 5
  • 6
42
votes
7 answers

Why doesn't the browser reuse the authorization headers after an authenticated XMLHttpRequest?

I'm developing Single Page App using Angular. The backend exposes REST services that require Basic authentication. Getting index.html or any of the scripts does not require authentication. I have an odd situation where one of my view has a
41
votes
1 answer

Accessibility in single page applications (ARIA etc)

What is the best approach to make an SPA (AngularJS) Accessible (for screen readers etc)? I have little to no experience with the aria specification, and I wonder if it will at all work on a single page application. What are the common pitfalls when…
Kenneth Lynne
  • 15,461
  • 12
  • 63
  • 79
40
votes
3 answers

Authentication for users on a Single Page App?

I have developed a single page app prototype that is using Backbone on the front end and going to consume from a thin RESTful API on the server for it's data. Coming from heavy server side application development (php and python), I have really…
38
votes
3 answers

how to embed an angular app into another app?

My team develop an angular 5 application that has been in production for a while, but we've been tasked recently with making the app work in other 3 sites the company owns. One site is a SPA built with Angular6, other is also a SPA but uses…
38
votes
3 answers

What is the best Vue-Router practice for very large webapplications?

I have to make a webapplication with many different modules (like a todo-module, document-modules, and a big usermanagement-module for admin users). The total number of pages is > 100. And the module access is different for each user. I am working…
angelique000
  • 899
  • 3
  • 10
  • 28