Created
May 3, 2020 11:28
-
-
Save armanozak/8344b5fa6fa1a6ad76df1fbc7577f2a6 to your computer and use it in GitHub Desktop.
[Strategy Pattern with TypeScript - ABP Angular Implementation] DomInsertionService Usage #blog #typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DomInsertionService, CONTENT_STRATEGY } from '@abp/ng.core'; | |
@Component({ | |
/* class metadata here */ | |
}) | |
class DemoComponent { | |
constructor(private domInsertionService: DomInsertionService) {} | |
ngOnInit() { | |
const scriptElement = this.domInsertionService.insertContent( | |
CONTENT_STRATEGY.AppendScriptToBody('alert()') | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment