I\'m using ASP.Net to render my Angular 2 app, and the only RAZOR page I have is the _Layout.cshtml and I would love to be able to pass some init data from RAZOR into my boo
It's not possible to use inputs for main components (bootstrapped ones). You need to get the attribute directly from the DOM:
@Component({
selector: 'my-app',
template: "<div id='mainBody'>Test:{{test}}</div>",
directives: [MenuBarComponent, ROUTER_DIRECTIVES]
})
export class AppComponent {
constructor(private elementRef:ElementRef) {
this.test = this.elementRef.nativeElement.getAttribute('test');
}
}