Angular 2不同的基本路线

时间:2016-12-24 22:03:22

标签: angular

我想将我的angular2基本路由更改为/以外的其他内容。

例如,

http:// localhost:27149/home

http:// localhost:27149/index.html#/home

或类似的东西。

感谢。

1 个答案:

答案 0 :(得分:0)

最后我们只需添加 {provide:LocationStrategy,useClass:HashLocationStrategy}

角度2引导中的

当然我们需要加载那些模块

从" @ angular / common";

导入{LocationStrategy,HashLocationStrategy}

希望这个帮助

相关问题