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 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 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

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

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

Difference between [ngClass] vs [class] binding

This is special Angular binding syntax <div [class.extra-sparkle]=”isDelightful”> This is part of the Angular compiler and you can’t build a custom binding variant following this binding style. The only supported are [class.xxx]=”…”, [style.xxx]=”…”, and [attr.xxx]=”…” ngClass is a normal Angular directive like you can build it yourself <div [ngClass]=”{‘extra-sparkle’: isDelightful}”> ngClass is more powerful. It … Read more