どのように使用できます[router-link]
か[inner-html]
例は次のとおりです。
import {Component, View} from 'angular2/angular2';
import {RouterLink, ROUTER_DIRECTIVES} from 'angular2/router';
@Component({
selector: 'index'
})
@View({
template: `
<div> Index Content </div>
<div [inner-html]="test"></div>
`,
directives: [ROUTER_DIRECTIVES]
})
export class Index {
private test: String;
constructor() {
this.test = `<a [router-link]="['/aRoute', 'AComponent']">Test</a>`;
}
}
Angular1 http://plnkr.co/edit/F91xvGHBASvqCGBJcEYY?p=previewのソリューションは次のとおりです。
Angular2 でどうすればできますか?