import { Component } from '@angular/core' ; import { DomSanitizer } from '@angular/platform-browser' ; import { MatIconRegistry } from '@angular/material' ; title @ Component ( { selector : 'icon-svg-example' , templateUrl : 'icon-svg-example.html' , styleUrls : [ 'icon-svg-example.css' ] , } ) export class IconSvgExample { constructor ( iconRegistry , sanitizer ) { iconRegistry . addSvgIcon ( 'thumbs-up' , sanitizer . bypassSecurityTrustResourceUrl ( 'assets/img/examples/thumbup-icon.svg' ) ) ; } }