I am looking to display the raw HTML code (example.component.html) below 'example works!'. The page should display the following:
example works!
<p>
example works!
</p>
I can find various resources showing how this can be done using AngularJS but not Angular 6.
I have tried to use [innerHTML] but this didn't work.
<p>
example works!
</p>
example.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'rt-example',
templateUrl: './example.component.html',
styleUrls: ['./example.component.css']
})
export class ExampleComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
app.component.html
<div style="text-align:center">
<rt-example></rt-example>
</div>
OUTPUT . . link to image