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
Show hidden characters
{ | |
"root": true, | |
"ignorePatterns": [ | |
"projects/**/*" | |
], | |
"overrides": [ | |
{ | |
"files": [ | |
"*.ts" | |
], |
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
function compose(...functions) { | |
return argument => functions.reduceRight((acc, current) => current(acc), argument); | |
} | |
function pipe(...functions) { | |
return argument => functions.reduce((acc, current) => current(acc), argument); | |
} | |
const users = [ | |
{ |
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
<div class="template-content"> | |
<ng-container [ngTemplateOutlet]="contact" [ngTemplateOutletContext]="context"></ng-container> | |
</div> |
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
import '...'; | |
@Component({ | |
selector: 'app-ng-template', | |
templateUrl: './ng-template.component.html', | |
styleUrls: ['./ng-template.component.scss'] | |
}) | |
export class NgTempalateComponent implements OnInit { | |
context = { | |
myFirstName: 'John Doe', |
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
<ng-container [ngTemplateOutlet]="contact" [ngTemplateOutletContext]="context"></ng-container> |
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
<ng-template let-firstName="myFirstName" let-greeting="greeting"> | |
<h2>Contact Template</h2> | |
<p>Hello, I am {{ firstName }}!</p> | |
<button (click)="greeting(firstName)">Show first name</button> | |
</ng-template> |
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
<ng-template #contact> | |
<h2>Contact Template</h2> | |
<p>Hello, I am contact template!</p> | |
</ng-template> | |
<div class="template-content"> | |
<ng-container [ngTemplateOutlet]="contact"></ng-container> | |
</div> | |
<div class="template-content"> |
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
<ng-template> | |
<h2>Hello! I am Template!</h2> | |
</ng-template> |
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
@Component({ | |
selector: 'app-node-type-list', | |
templateUrl: './node-type-list.page.html', | |
styleUrls: ['./node-type-list.page.scss'] | |
}) | |
export class NodeTypeListPage implements OnInit { | |
constructor(private viewContainerRef: ViewContainerRef) { } | |
// Some code... | |
} |
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) { } |
NewerOlder