import { Pipe , PipeTransform } from '@angular/core' ; import { DomSanitizer } from '@angular/platform-browser' ; @ Pipe ( { name : 'paginationTotalPagesFormat' } ) export class PaginationTotalCountFormat implements PipeTransform { constructor ( private sanitizer ) { } transform ( count , format ) { if ( count && format ) { return this . sanitizer . bypassSecurityTrustHtml ( format . replace ( /\{(.+?)\}/g , `<span>${ count }</span>` ) ) ; } else { return '' ; } } }