如何在angular2中动态地设置第一个URL为基URL



我将我的angular2应用注入到另一个应用部门,默认情况下url包含一个大查询字符串。如何在angular2

中设置url和查询字符串作为基础url
exp url: http.example.com/this/thai?this=thhtyy&ttthh

{provide: APP_BASE_HREF, useValue: '/'},

这是因为你使用/作为你的基础URL。你可以将你的基础URL更改为你在代码中获得的第一个URL。

{provide: APP_BASE_HREF, useValue: window.document.location.href}

最新更新