single-page-application

Is store.dispatch in Redux synchronous or asynchronous

和自甴很熟 提交于 2019-11-26 20:44:37
I realize this is a basic question but I had no luck finding the answer elsewhere. Is store.dispatch synchronous or asynchronous in Redux ? In case it is asynchronous is there a possibility to add a callback after the action has been propagated as it is possible with React ? agpt AFAIK, dispatching action is synchronous. In case if you are willing to address the asynchronous call, you can use the thunk-middleware in redux, where dispatch is provided as a callback function which you can invoke as per your convenience. For more info, checkout this answer on SO by Author itself: How to dispatch a

visual studio not updating html / javascript to server / browser

旧城冷巷雨未停 提交于 2019-11-26 20:23:34
问题 This is an MVC 4 app using the Hot Towel SPA template. Whenever I change anything in the HTML and/or javascript the only way I can get the new code to display is to clear the browser cache. F5, cntrl-F5, shift-F5, nothing works. I'm not normally a web dev and just learning this. I've done regular MVC before and not had this issue, maybe it has to do with where the HTML and javascript is in my project (i.e. in the /App folder) ?. I'm going nuts trying to figure this out. I can completely

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

拟墨画扇 提交于 2019-11-26 20:08:32
问题 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

Spring catch all route for index.html

ぃ、小莉子 提交于 2019-11-26 19:23:00
问题 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

Can I create routes with react-router for a github-pages site?

可紊 提交于 2019-11-26 17:19:02
问题 Ok, so I've made a SPA using React and React-Router and have pushed it to github pages, but none of the routes I have written work when I refresh or click back in my browser. I had the same problem when I was serving the page locally, but then followed along to this SO answer and made a server.js file which provided a redirect to my static HTML page at each route. Here is what the file looks like: "use strict"; let express = require('express'); let path = require('path'); let app = express();

Configure spring boot to redirect 404 to a single page app

别等时光非礼了梦想. 提交于 2019-11-26 16:56:36
问题 I want to configure my Spring Boot app to redirect any 404 not found request to my single page app. For example if I am calling localhost:8080/asdasd/asdasdasd/asdasd which is does not exist, it should redirect to localhost:8080/notFound . The problem is that I have a single page react app and it runs in the root path localhost:8080/ . So spring should redirect to localhost:8080/notFound and then forward to / (to keep route). 回答1: This should do the trick: Add an error page for 404 that

AngularJS routing without a web server

拈花ヽ惹草 提交于 2019-11-26 16:36:17
问题 I want to develop html5 SPA application for a thin client. There is no way to launch any web server on it. And I can't to make routing works without web server. My index.html <!doctype html> <html ng-app="app"> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script> <script src="app.js"></script> <title></title> </head> <body style="background-color: white;"> <h1>Index</h1> <a id="link" href="/login">Go to login</a> <div ng-controller="HomeCtrl">

Tell screen reader that page has changed in Backbone/Angular single-page app

岁酱吖の 提交于 2019-11-26 15:58:30
问题 Imagine you have a simple, single-page application - regardless of whether it was written using Backbone, Angular, Ember or anything else. How can you tell a screen reader that we've changed 'page' when a route is followed? In a classic application, when I navigate from /index.html to /about.html the screen reader obviously detects the page change, and re-reads as you'd expect. In my Backbone application though, when I follow a route I cannot work out how to trigger a 're-read'. I've tried

How would I have ui-router go to an external link, such as google.com?

妖精的绣舞 提交于 2019-11-26 12:45:54
问题 For example: $stateProvider .state(\'external\', { url: \'http://www.google.com\', }) url assumes that this is an internal state. I want it to be like href or something to that effect. I have a navigation structure that will build from the ui-routes and I have a need for a link to go to an external link. Not necessarily just google, that\'s only an example. Not looking for it in a link or as $state.href(\'http://www.google.com\'). Need it declaratively in the routes config. 回答1: Angular-ui

How can I use cshtml files with Durandal?

こ雲淡風輕ζ 提交于 2019-11-26 12:09:30
问题 I got the DurandalJS StarterKit template on VS2012... All works great... But in some views I need to do something like that: @if (Roles.IsUserInRole(\"Administrators\")) { <p>Test</p> } However with durandal all my views are \'.html\' files... Is that possible to use \'.cshtml\' files to access some information like that? Or is there any other way to do that with durandal? Junior 回答1: Yes, you can absolutely use cshtml files with Durandal and take advantage of Razor on the server. I assume