这是我的html:
<a class="dropdown-item" [routerLink]="['/videos', p.param]">{{ p.title }}</a>
以下是app.route.ts中的代码:
{
path: 'videos/:folder',
loadComponent: () => import('./pages/application/video/video.component')
.then(mod => mod.VideoComponent)
},
这是VideoComponent中的代码(是一个独立的组件,我试图获取值文件夹:
ngOnInit(): void {
this.route.paramMap
.subscribe(
(params: any) => {
console.log("value params folder:" + params);
this.folder = params.folder; <--- no value.
}
)
}
and params.folder has no value.
I google it but I haven't seen any thing.
Is stand alone component support this feature or is there a way to get pass a parameter thru a stand alone component? Is there any link/example how to do it?
谢谢