How can I use angular 2 and razor views to get to
<my-component [items]= @Model.Items ></my-component>
Model is a Mvc.net.
I am using typescript. Component templates are inline and not using template url
At help appreciated
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<h2>My favorite skill is: {{myskills}}</h2>
<p>Skill:</p>
<ul>
<li *ngFor="let skl of skills">
{{ skl }}
</li>
</ul>
`
})
export class AppComponent {
title = 'ASP.NET MVC 5 with Angular 2';
skills = ['MVC 5', 'Angular 2', 'TypeScript', 'Visual Studio 2015'];
myskills = this.skills[1];
}
http://www.mithunvp.com/using-angular-2-asp-net-mvc-5-visual-studio/ And checkout this link for the github project per the link above.