![](/img/trans.png)
[英]Component doesn't get contentChildren when using routerLink angular 6-7
[英]My angular component is not updated when using routerLink
我有以下問題:當我使用<a href="conceptos/edit-conceptos/{{ concepto.id}}">
標記修改 edit-conceptos 組件中的字段並返回到 list-conceptos 組件時,更改已反映,但routerLink="../edit-conceptos/{{ concepto.id }}不會發生這種情況。
我正在使用 apollo-client 使用列表服務和更新服務。
以下組件負責列出
ngOnInit(): void {
this.conceptoService.getConceptos().
subscribe(
(res) => {
this.conceptos = [...res];
}
(err) => {
console.log(err)
}
)}
謝謝你
以這種方式嘗試:
<a [routerLink]="[‘/edit-conceptos’, concepto.id]">
注意:看一下圖片中的拼寫錯誤"list-concetos" ,而不是 "list-conceptos"
在您的情況下,與href
等效的routerLink
將是:
[routerLink]="['edit-conceptos', concepto.id]"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.