标签: angular generics
我想从路由模块将类型传递给组件,这可能吗?
例如:
export class UserComponent<T> implements OnInit { users: T[]; }
,我想从路由中调用它:
{ path: 'view-user', component: UserComponent<UserType>,canActivate:[UserGuard] },