Notice: file_put_contents(): Write of 16797 bytes failed with errno=28 No space left on device in /var/www/tgoop/post.php on line 50
Frontender Libs - обзор библиотек JS / CSS@sWebDev P.3633
SWEBDEV Telegram 3633
Динамическое управление представлениями

EmbeddedViewRef - это ссылка на конкретный экземпляр представления, созданный из TemplateRef. В отличие от ComponentRef, он относится к шаблону (<ng-template>), что позволяет динамически отображать пользовательский интерфейс.
import { Component, ViewChild, ViewContainerRef, TemplateRef } from '@angular/core';

@Component({
selector: 'app-example',
template: `
<ng-template #t><div>Шаблон</div></ng-template>
<div #c></div>
<button (click)="create()">Создать</button>
`,
})
export class ExampleComponent {
@ViewChild('t', { read: TemplateRef }) tRef!: TemplateRef<any>;
@ViewChild('c', { read: ViewContainerRef }) cRef!: ViewContainerRef;

create() {
this.cRef.createEmbeddedView(this.tRef);
}
}


Пример: @ViewChild получает TemplateRef (tRef) и ViewContainerRef (cRef). createEmbeddedView создает и вставляет шаблон.

👉 @sWebDev
👍3



tgoop.com/sWebDev/3633
Create:
Last Update:

Динамическое управление представлениями

EmbeddedViewRef - это ссылка на конкретный экземпляр представления, созданный из TemplateRef. В отличие от ComponentRef, он относится к шаблону (<ng-template>), что позволяет динамически отображать пользовательский интерфейс.

import { Component, ViewChild, ViewContainerRef, TemplateRef } from '@angular/core';

@Component({
selector: 'app-example',
template: `
<ng-template #t><div>Шаблон</div></ng-template>
<div #c></div>
<button (click)="create()">Создать</button>
`,
})
export class ExampleComponent {
@ViewChild('t', { read: TemplateRef }) tRef!: TemplateRef<any>;
@ViewChild('c', { read: ViewContainerRef }) cRef!: ViewContainerRef;

create() {
this.cRef.createEmbeddedView(this.tRef);
}
}


Пример: @ViewChild получает TemplateRef (tRef) и ViewContainerRef (cRef). createEmbeddedView создает и вставляет шаблон.

👉 @sWebDev

BY Frontender Libs - обзор библиотек JS / CSS




Share with your friend now:
tgoop.com/sWebDev/3633

View MORE
Open in Telegram


Telegram News

Date: |

There have been several contributions to the group with members posting voice notes of screaming, yelling, groaning, and wailing in different rhythms and pitches. Calling out the “degenerate” community or the crypto obsessives that engage in high-risk trading, Co-founder of NFT renting protocol Rentable World emiliano.eth shared this group on his Twitter. He wrote: “hey degen, are you stressed? Just let it out all out. Voice only tg channel for screaming”. Matt Hussey, editorial director of NEAR Protocol (and former editor-in-chief of Decrypt) responded to the news of the Telegram group with “#meIRL.” A Telegram channel is used for various purposes, from sharing helpful content to implementing a business strategy. In addition, you can use your channel to build and improve your company image, boost your sales, make profits, enhance customer loyalty, and more. While the character limit is 255, try to fit into 200 characters. This way, users will be able to take in your text fast and efficiently. Reveal the essence of your channel and provide contact information. For example, you can add a bot name, link to your pricing plans, etc. Hui said the time period and nature of some offences “overlapped” and thus their prison terms could be served concurrently. The judge ordered Ng to be jailed for a total of six years and six months.
from us


Telegram Frontender Libs - обзор библиотек JS / CSS
FROM American