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 *ngFor="let userName of usersName$ | async"> | |
{{ userName }} | |
</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 } from '@angular/core'; | |
import { Observable } from 'rxjs'; | |
import { map } from 'rxjs/operators'; | |
import { UsersGQL } from '../generated/types.graphql-gen'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.scss'] |
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
query Users { | |
users { | |
data { | |
name | |
} | |
} | |
} |
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
overwrite: true | |
schema: "schema.graphql" | |
documents: "src/**/*.graphql" | |
generates: | |
src/generated/types.graphql-gen.ts: | |
plugins: | |
- "typescript" | |
src/generated: | |
preset: near-operation-file | |
presetConfig: |
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: 'my-app', | |
template: ` | |
<ng-template cdkPortal #testTemplate="cdkPortal" let-name> | |
<div>User {{ name }} </div> | |
</ng-template>`, | |
}) | |
export class AppComponent implements OnInit { | |
@ViewChild('testTemplate') testTemplatePortal: TemplatePortal<any>; |
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: 'my-app', | |
template: ` | |
<ng-template #testTemplate let-name> | |
<div>User {{ name }} </div> | |
</ng-template>`, | |
}) | |
export class AppComponent implements OnInit { | |
@ViewChild('testTemplate') testTemplate: TemplateRef<any>; | |
private portalHost: DomPortalHost; |
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: 'my-app', | |
template: ` | |
<ng-template #testTemplate let-name> | |
<div>User {{ name }} </div> | |
</ng-template>` | |
}) | |
export class AppComponent implements OnInit { | |
private componentRef; |
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-test', | |
template: ` | |
<ng-content [cdkPortalHost]="_portalInstance"></ng-content> | |
<ng-template cdkPortal #cartCount> | |
<div>Hello World</div> | |
</ng-template> | |
` | |
}) | |
export class TestComponent implements OnInit { |
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-test', | |
template: ` | |
<ng-content [cdkPortalHost]="_portalInstance"></ng-content> | |
` | |
}) | |
export class TestComponent implements OnInit { | |
_portalInstance: Portal<any>; | |
constructor() { } |
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 { DomPortalHost, Portal, ComponentPortal } from '@angular/cdk/portal'; | |
@Component({ | |
selector: 'my-app', | |
template: '', | |
}) | |
export class AppComponent implements OnInit { | |
private portalHost: DomPortalHost; | |
private portal: ComponentPortal<HeaderComponent>; |
NewerOlder