import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'typeaheadHighlight' } ) export class TypeaheadHighlight implements PipeTransform { transform ( value , searchQuery ) { const regex = new RegExp ( searchQuery , 'i' ) ; return value . replace ( regex , `<b><u>${ value . match ( regex ) }</u></b>` ) ; } }