Struggling with redirecting my app outside of Angular to the logout page. I've tried using $window.location.href
, but it doesn't work in Firefox.
Someone recommended using $window.location
directly, but I'm writing in TypeScript so I need to create a new Location object instead of just assigning my string to it...
After checking lib.d.ts, I found that location is declared as:
declare var Location: {
prototype: Location;
new(): Location;
}
I adjusted my code to:
var url: string = "http:\\\\host:port/blabla/logout";
var loc: Location = new Location();
loc.href = url;
this.$window.location = loc;
However, I received this error:
Error: Illegal constructor.
Any suggestions on how to create the Location object? Is this best practice? Any other insights?
Thanks