我试图弄清楚在声明路线时如何将参数传递给组件。
{
path: 'registration',
component: RegistrationComponent,
data: { title: 'Registration' },
canActivate: [GuestOnlyGuard]
}
export class RegistrationComponent implements OnInit {
@Input() mode: string = 'default';
@Input() showSubmitBtn: boolean = true;
@Input() showLoginNavigationLink: boolean = true;
@Output('onComplete') completed: EventEmitter<UserRegistrationInfo> = new EventEmitter<UserRegistrationInfo>();
/...... Implementation........./
}
&#13;
我希望在从路径加载组件时将特定模式传递给注册组件。