Angular 4 - 从路径传递组件输入

时间:2017-08-15 12:59:48

标签: angular

我试图弄清楚在声明路线时如何将参数传递给组件。



{ 
    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;
&#13;
&#13;

我希望在从路径加载组件时将特定模式传递给注册组件。

0 个答案:

没有答案