diff --git a/npm/ng-packs/packages/core/src/lib/services/dom-insertion.service.ts b/npm/ng-packs/packages/core/src/lib/services/dom-insertion.service.ts index 71f59798ae..0754205f33 100644 --- a/npm/ng-packs/packages/core/src/lib/services/dom-insertion.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/dom-insertion.service.ts @@ -4,7 +4,7 @@ import { generateHash } from '../utils'; @Injectable({ providedIn: 'root' }) export class DomInsertionService { - readonly inserted = new Set(); + private readonly inserted = new Set(); insertContent( contentStrategy: ContentStrategy, @@ -25,4 +25,10 @@ export class DomInsertionService { element.parentNode.removeChild(element); } + + has(content: string): boolean { + const hash = generateHash(content); + + return this.inserted.has(hash); + } }