### File

`modules/utils/src/ngui-highlight.pipe.ts`

### Metadata

name | nguiHighlight

### Methods

transform
`transform(text: string, search: string)`
Defined in modules/utils/src/ngui-highlight.pipe.ts:5
Parameters :
Name | Type | Optional
text | `string` | no
search | `string` | no
Returns : `string`

    import { Pipe, PipeTransform } from '@angular/core';

    @Pipe({ name: 'nguiHighlight' })
    export class NguiHighlightPipe implements PipeTransform {
      transform(text: string, search: string): string {
        let ret = text;
        if (search) {
          const re  = new RegExp(search, 'ig');
          ret = text.replace(re, match => `<span class="ngui-highlight">${match}</span>`);
        }

        return ret;
      }
    }

# results matching ""

# No results matching ""