1
如何將當前URL轉換爲相應的狀態?結果狀態將用於使用$ state.go的狀態轉換。使用ui-router獲取狀態給定的URL AngularJS 1.x
實施例: http://localhost/auth/enterprise/
登記路徑:
{
"stateName": "auth.context",
"url": ":context"
}
結果:AUTH /企業/ => auth.context
實施例: http://localhost/auth/enterprise/esdrubal
登記路徑:
{
"stateName": "auth.context",
"url": ":context/:username"
}
結果:AUTH /企業/ esdrubal => auth.context
什麼是你想達到什麼目的?用於身份驗證的某種回調URL?例如, OAuth?在這種情況下,沒有客戶端JS能夠做到這一點 –
我想要做的是將當前URL轉換爲註冊狀態,並在$ state.go上使用該狀態來進行轉換。 –