Pass Razor model to Angular 5 component
问题 I have this in my asp.net razor view: @model IEnumerable<MyClass> <app-root [(myModel)]="'@Model'"></app-root> and this import { Component } from '@angular/core'; import { Input } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styles: [] }) export class AppComponent { title = 'app'; @Input() public myModel: any; ngOnInit() { console.log(this.myModel); } } Output in console says "udefined"... I have tried to name 'myModel' as ngModel, i have tried