Last active
July 30, 2020 17:29
-
-
Save rexar1988/89ce8e40265f610bd025a4fc0d744910 to your computer and use it in GitHub Desktop.
ViewContainerRef example
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
// Внедрение в компонент | |
// this.viewContainerRef это ссылка на HTML-шаблон компонента | |
constructor(private viewContainerRef: ViewContainerRef) { } | |
// Внедрение в директиву | |
// this.viewContainerRef это ссылка на HTML-элемент директивы, | |
// который можно получить с помощью свойства this.templateRef | |
constructor(private templateRef: TemplateRef<ElementRef>, | |
private viewContainerRef: ViewContainerRef) { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment