How do I create my components in (nested) markup?
<component-name [field]="value"></component-name> doesn't seem to work.
Consider the following example:
import {bootstrap, Component, FORM_DIRECTIVES, CORE_DIRECTIVES} from 'angular2/angular2'; @Component({ selector: "hero-detail", directives: [FORM_DIRECTIVES, CORE_DIRECTIVES], template: `Name: {{name}}` }) class HeroDetail { public name: string; } @Component({ selector: 'my-app', directives: [FORM_DIRECTIVES, CORE_DIRECTIVES, HeroDetail], template:` <h1>Heroes</h1> <hero-detail [name]="name"></hero-detail> ` }) class AppComponent { public name: string = "Funky name"; } bootstrap(AppComponent); Outputs:
Name: