import { Injectable } from '@angular/core';
import { DomSanitizationService, SecurityContext } from '@angular/platform-browser';

@Injectable()
export class NoSanitizationService {
    sanitize(ctx: SecurityContext, value: any): string {
        return value;
    }
}

export const NO_SANITIZATION_PROVIDERS: any[] = [
    {provide: DomSanitizationService, useClass: NoSanitizationService}
];
import { Injectable, provide } from '@angular/core';
import { DomSanitizationService, SecurityContext } from '@angular/platform-browser';

@Injectable()
export class NoSanitizationService {
    sanitize(ctx: SecurityContext, value: any): string {
        return value;
    }
}

export const NO_SANITIZATION_PROVIDERS: any[] = [
    provide(DomSanitizationService, { useClass: NoSanitizationService }),
];
--- 
+++ 
@@ -1,4 +1,4 @@
-import { Injectable, provide } from '@angular/core';
+import { Injectable } from '@angular/core';
 import { DomSanitizationService, SecurityContext } from '@angular/platform-browser';
 
 @Injectable()
@@ -9,5 +9,5 @@
 }
 
 export const NO_SANITIZATION_PROVIDERS: any[] = [
-    provide(DomSanitizationService, { useClass: NoSanitizationService }),
+    {provide: DomSanitizationService, useClass: NoSanitizationService}
 ];
Update NoSanitizationService to not use deprecated apis
