I\'m trying to create an Angular2 custom pipe that outputs raw html. I want it to simply convert newlines in the input into HTML line breaks. How do I output raw HTML from a
use angular directive
import { Directive, ElementRef } from '@angular/core'; @Directive({ selector: '[shareLineBreaker]', }) export class LineBreakerDirective { constructor(el: ElementRef) { el.nativeElement.style['white-space'] = 'pre-line' } }
then
{{data.users | arraymap:'\n':'n':'l' }}