Passing @Input and subscribing to @Output while navigating to a Route in Angular 2 Component
- 阅读更多 关于 Passing @Input and subscribing to @Output while navigating to a Route in Angular 2 Component
When we navigate to a route and load components, Can we pass variable decorated with @Input in loaded child component and can we subscribe to EventEmitter decorated with @Output ? Is there any lifecycle Hook available in parent, where Route is defined and we may get a reference to loaded component, so as to pass values\subscribe functions to child component dynamically? Parent Component @Component({ moduleId: module.id, selector: "parent", templateUrl: "<router-outlet></router-outlet>" }) @Routes([ { path: "/child-component1", component: Child1Component } ]) export class Parent { // Can we