I want to inject html in my a-component with angular2 tags from another component.
@Component({
selector: 'app-root',
template: '<app-a [my-html]="my-html"> </app-a>',
styleUrls: ['./app.component.css']
})
export class AppComponent {
my-html= '<span> {{variableFromAComponent}}</span>';
}
@Component({
selector: 'app-a',
template: '<div [innerHtml]="my-html"> </div>',
})
export class AComponent {
@Input('my-html') my-html:any;
public variableFromAComponent='its work!';
}
I want to see in result : its work! (from variableFromAComponent) But i see {{variableFromAComponent}} (angular2 tags doesn't work).