Is there any way to pas parameters to the root of an Angular 2 Component? I have been able to do this with the components that are part of the internal component template but not with the root component:
<my-component [test] = "some-val"></my-component>
On my component:
export class AppComponent implements OnInit {
test: string;
ngOnInit() {
console.log(this.test); //test is undefined
}
}
The reason to do this is use Razor variables to be pass to Angular. Like editing a user for instance. I could do something like:
<edit-form [model] = "@Model.Id" > </edit-form>