1
重述我剛纔的問題,我有這條路,給了我這樣的事情/order-screen/store/1/London
Angular2網址參數返回NaN的
{
path: 'order-screen/store/:storeId/:storeLocation',
component: OrderComponent
}
當我嘗試使用storeLocation
this.route.params
它返回的NaN
錯誤來獲得。我想要得到的位置London
,不知道如果.params
是正確的使用。
this.routeSub = this.route.params.subscribe(params => {
this.storeLocation = +params['storeLocation'];
console.log('Location >> ', this.storeLocation);
})
呀想通早些時候,不知何故我對我自己的問題沒意見」 t後。但我會給你的答案檢查:) – MrNew
很高興你沒有卡住那裏太久,並找出你自己的:) –