single-page-application

How to disable caching of single page application HTML file served through IIS?

ぐ巨炮叔叔 提交于 2019-11-28 06:48:39
I have a single page application (angular-js) which is served through IIS. How do I prevent caching of HTML files? The solution needs to be achieved by changing content within either index.html or the web.config, as access to IIS through a management console is not possible. Some options I am currently investigating are: web.config caching profiles - http://www.iis.net/configreference/system.webserver/caching web.config client cache - http://www.iis.net/configreference/system.webserver/staticcontent/clientcache meta tags - Using <meta> tags to turn off caching in all browsers? IIS is version 7

Angular2 How to clean up the AppModule

落花浮王杯 提交于 2019-11-28 06:04:56
I've been using the tutorials online and created an 'ok' SPA data entry application. I have it connecting to my WEB API fine but have only built out one Model and already my AppModule has quiet a few lines. I'm thinking forward and using the current method I think the AppModule will be a crazy size once i finish with it, tough to read and possibly even tougher to debug. Have I possibly missed the point of how to structure an Angular2 larger application? I'm struggling to find a tutorial/project online that is larger than 1 component for reference. Below is my app.module.ts and folder structure

Can I use the browser Navigation Timing API for Ajax events in single page apps? If not, what's a good tool?

最后都变了- 提交于 2019-11-28 06:00:39
We've got a single page app built with Knockout and Backbone which makes Ajax calls to the server and does some complex data caching and DOM rendering. We're really like to measure the performance (and log it back to the server) as seen by the user. I can't seem to get my head wrapped around whether the browser Navigation Timing API is going to be useful for this or not. From what I see in examples, the Navigation Timing API is tied to window.performance and this is limited to the page load and not suitable for monitoring Ajax behavior. True or false? If false, what else can I use? I'd love to

how to embed an angular app into another app?

心不动则不痛 提交于 2019-11-28 06:00:17
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 Angular5, while the other is using some older libraries such as jQuery. Management wanted us to integrate with the Angular5 SPA right away so we just exported the whole application as a module with child routes and let the other application do the bootstrap. But I'm afraid the above approach will not work for the non-angular site. This also tight couple

AngularJS UI-Router multiple pages

↘锁芯ラ 提交于 2019-11-28 05:32:26
As Angular is SPA that's terrific, but what if I need some other page not related to index.html, how is realised by UI-Router states with different ui-views? For example, I have index.html : <!DOCTYPE html> <html data-ng-app="npAdmin"> <head> ... </head> <body> <header> <data-user-profile class="user-profile"></data-user-profile> </header> <section class="content-wrapper"> <aside data-main-menu></aside> <div class="main-content" data-ui-view></div> </section> <footer class="row"></footer> ... </body> </html> app.js : var app = angular.module('npAdmin', ['ui.router']); app.config(['

.NET core 2.1 base href tag on Angular template

萝らか妹 提交于 2019-11-28 05:21:57
问题 I'm building a template for our team on top of the .NET Core 2.1 + Angular 5 template included in the latest release of core 2.1, we deploy applications into virtual folders, for example /it/myapp, or /aa/myotherapp On the 2.0 template the base href property would be set automatically, I'm assuming because it was built with razor, like this: <base href="~/" /> However this is not true for the 2.1 template, I'm assuming it's because the template actually only uses static files, with the new

Dealing with expired access tokens in OAuth2 implicit grant

房东的猫 提交于 2019-11-28 04:56:25
The specification of OAuth2 states that an authorization server must not issue a refresh token when using implicit grant. In our use case we protect a RESTful API with OAuth2 and use a Single Page Javascript application as a client for this API. As it would be very difficult to redirect to the authorization server after an access token has expired, we are searching for a better way to get a new valid token. I could think about two different approaches and wonder which one could be better: Use a hidden iframe to Rerequest a valid access token. For this it is necessary to include a parameter

Spring catch all route for index.html

谁都会走 提交于 2019-11-28 04:43:15
I'm developing a spring backend for a react-based single page application where I'm using react-router for client-side routing. Beside the index.html page the backend serves data on the path /api/** . In order to serve my index.html from src/main/resources/public/index.html on the root path / of my application I added a resource handler @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/").addResourceLocations("/index.html"); } What I want to is to serve the index.html page whenever no other route matches, e.g. when I call a path other

How to compress URL parameters

孤街醉人 提交于 2019-11-28 03:39:16
Say I have a single-page application that uses a third party API for content. The app’s logic is in-browser only, and there is no backend I can write to. To allow deep-linking into the state of the app, I use pushState to keep track of a few variables that determine the state of the app (note that Ubersicht’s public version doesn’t do this yet). In this case repos , labels , milestones and username , show_open (bool) and with_comments (bool) and without_comments (bool). The URL format is ?label=label_1,label_2,label_3&repos=repo_1… . Values are the usual suspects, roughly [a-zA-Z][a-zA-Z0-9_-]

How to authenticate SPA users using oAuth2?

老子叫甜甜 提交于 2019-11-28 01:55:30
Alright, I've spent several days looking for a proper solution on how to properly authenticate users when working with SPAs. I have my own website. I have my own API. I have my own Single Page Application. I have my own database of users. The Goal : I need to get an access_token by providing a username and a password. I looked at OAuth2 Implicit Grant, but it requires users to Approve/Decline the app after successful authentication. It doesn't work in my case since I own both the app and the API. I looked at OAuth2 Password Grant, which is not perfect since I need to expose client_id/client