Last active
September 17, 2020 09:02
-
-
Save Mayankgupta688/8de94f640a31e26f8e4d36086bec42ac to your computer and use it in GitHub Desktop.
This file contains 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
@Directive({ | |
selector: '[delayRendering]' | |
}) | |
export class DelayRenderingDirective { | |
constructor( | |
private template: TemplateRef<any>, | |
private container: ViewContainerRef | |
) { } | |
@Input() | |
set delayRendering(delayTime: number): void { } | |
ngOnInit() { | |
setTimeout(() => { | |
this.container.createEmbeddedView(this.template); | |
}, this.delayRendering); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment