[英] How to get base url in angular 5?
我现在的网址是http://localhost:4200/test/dashboard.
我想打印基地网址,即http://localhost:4200使用角5功能.
/**/
我现在的网址是http://localhost:4200/test/dashboard.
我想打印基地网址,即http://localhost:4200使用角5功能.
安慰日志(log)(位置);
console.log(location.href);
要获取基本url,请执行以下操作:console.log(location.origin);