How can I use [router-link]
in [inner-html]
Here is the example :
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>`;
}
}
Here is the solution for Angular1 http://plnkr.co/edit/F91xvGHBASvqCGBJcEYY?p=preview
How can I do it in Angular2 ?