Check out this: How to remove HTML tags from content?
Edit: It’s really only this part which is relevant
strip(html: string) {
return html.replace(/<(?:.|\n)*?>/gm, '');
}
You can add that to a pipe if you want, so it’s just {{stringwithhtml | stripHTML}}
import { Injectable, Pipe } from '@angular/core';
@Pipe({
name: 'stripHTML'
})
@Injectable()
export class stripHTML {
transform(html: string) {
return html.replace(/<(?:.|\n)*?>/gm, '');
}
}