Skip to content

Instantly share code, notes, and snippets.

@armanozak
Created May 3, 2020 11:28
Show Gist options
  • Save armanozak/8344b5fa6fa1a6ad76df1fbc7577f2a6 to your computer and use it in GitHub Desktop.
Save armanozak/8344b5fa6fa1a6ad76df1fbc7577f2a6 to your computer and use it in GitHub Desktop.
[Strategy Pattern with TypeScript - ABP Angular Implementation] DomInsertionService Usage #blog #typescript
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