When would you set location to a URL string versus setting location.href?
location = \"http://www.stackoverflow.com\";
With TypeScript use window.location.href as window.location is technically an object containing:
Properties
hash
host
hostname
href <--- you need this
pathname (relative to the host)
port
protocol
search
Setting window.location will produce a type error, while
window.location.href is of type string.
Source