[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 中做到这一点?