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

Angular-ui-router doesn’t support external URL, you need redirect the user using either $location.url() or $window.open() I would suggest you to use $window.open(‘http://www.google.com’, ‘_self’) which will open URL on the same page. Update You can also customize ui-router by adding parameter external, it can be true/false. $stateProvider .state(‘external’, { url: ‘http://www.google.com’, external: true }) Then configure … Read more

How to connect API with Web SPA through docker

If you want to start all of your apps with a single command using docker, the only option is docker-compose. Using docker-compose is just for test purposes or a very limited production infrastructure. Best approach is to have your artifacts in different host each one. Please read these to understand some points: one service per … Read more

how to embed an angular app into another app?

UPDATE 2020 You can also use the new Webpack 5 Module federation. following examples show how to use module federation with Angular and other technologies. Implementation examples of module federation , by the creators of module federation Example for building a plugin-based workflow designer with Angular and Dynamic Module Federation Dynamic Module Federation with Angular … Read more

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

Adding the following into web.config solution worked across Chrome, IE, Firefox, and Safari: <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <location path=”index.html”> <system.webServer> <httpProtocol> <customHeaders> <add name=”Cache-Control” value=”no-cache” /> </customHeaders> </httpProtocol> </system.webServer> </location> </configuration> This will ensure that the that Cache-Control header is set to no-cache when requesting index.html.

How should I configure create-react-app to serve app from subdirectory?

In addition to your requirements, I am adding mine: It should be done by CD, through an env variable. If I need to rename the subdirectory, I should only have to change the env variable. It should work with react-router. It should work with scss (sass) and html. Everything should work normally in dev mode … Read more

Spring catch all route for index.html

Since my react app could use the root as forward target this ended up working for me @Configuration public class WebConfiguration extends WebMvcConfigurerAdapter { @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController(“/{spring:\\w+}”) .setViewName(“forward:/”); registry.addViewController(“/**/{spring:\\w+}”) .setViewName(“forward:/”); registry.addViewController(“/{spring:\\w+}/**{spring:?!(\\.js|\\.css)$}”) .setViewName(“forward:/”); } } To be honest I have no idea why it has to be exactly in this specific format … Read more

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

The AngularJS documentation does in fact mention this Server side Using this mode requires URL rewriting on server side, basically you have to rewrite all your links to entry point of your application (e.g. index.html) In this case, one Java-based solution is to tell the server “map all urls to index.html.” This can be done … Read more

CSRF Token necessary when using Stateless(= Sessionless) Authentication?

I found some information about CSRF + using no cookies for authentication: https://auth0.com/blog/2014/01/07/angularjs-authentication-with-cookies-vs-token/ “since you are not relying on cookies, you don’t need to protect against cross site requests” http://angular-tips.com/blog/2014/05/json-web-tokens-introduction/ “If we go down the cookies way, you really need to do CSRF to avoid cross site requests. That is something we can forget when … Read more

Is store.dispatch in Redux synchronous or asynchronous

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 Redux … Read more