2017-03-27 57 views

回答

1

正如Bougarfaoui薩爾瓦多houcine指出,表達category.attributes.alias-name是interprete作爲substration。並減去undefined = Nan。 所以,儘量使用此代碼擺脫你的錯誤

<a [routerLink]="[category.attributes['alias-name'], '1']"> 
1

這可能會實現:

<a [routerLink]="[category.attributes.alias-name, '1']"> 
+0

我的意思是category.attributes.alias名是NaN在瀏覽器查詢網址 – denqxotl

+0

你什麼時候加''

{{category.attributes.alias-name}}
你的組件模板中,您得到什麼表現?我不知道'category.attributes.alias-name'應該返回什麼,以及它是否會返回。 –

+0

參數應該只是字符串values.if URL更新像http://localhost8201/category/page=1然後你可以從激活的路線 – Vignesh

0

試試這個:

<a [routerLink]="[category.attributes['alias-name'], '1']"> 
+0

雖然這段代碼可能會回答這個問題,但提供關於如何解決問題和/或爲什麼解決問題的附加背景可以提高答案的長期價值。 –