ngx-multiline

Plugin for Angular providing a pipe to display multiline text

Usage no npm install needed!

<script type="module">
  import ngxMultiline from 'https://cdn.skypack.dev/ngx-multiline';
</script>

README

ngx-multiline

build license issues

Plugin for Angular (>=7.2.0) providing a pipe to display multiline text.

Installation

For use in an existing angular project run npm install ngx-multiline.

Now add the installed module to your app.module.ts:

import { MultilineModule } from 'ngx-multiline';

// ...

@NgModule({
  // ...
  imports: [
    // ...
    MultilineModule
  ]
  // ...
})
export class AppModule { }

Usage

Anywhere in your template:

<div [innerHtml]="somePreformattedText | multiline"></div>

The pipe will transform every \n to a <br/>. Every \n\n will result in a </p><p>. The plugin does work for Windows end-of-line sequence \r\n as well.

License

MIT - Vinado - Built with :heart: in Dresden