2016-12-24 142 views
-2

我想將我的角度2基本路線更改爲/以外的路線。角度2不同的基本路線

例如,

http:// localhost:27149/home 

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

或類似的東西。

謝謝。

+1

你是什麼意思? – Milad

+0

誰投了票??D – Milad

+0

您使用的是webpack嗎?或者是什麼 ? – Milad

回答

0

最後,我們只需要添加{提供:LocationStrategy,useClass:HashLocationStrategy}

在角2引導

當然

我們需要加載這些模塊

進口{LocationStrategy

,來自「@ angular/common」的HashLocationStrategy};

希望得到這個幫助