import { isPlatformServer } from '@angular/common'; import { AfterViewInit, Component, computed, ElementRef, PLATFORM_ID, ViewEncapsulation, inject, input, viewChild, } from '@angular/core'; import { ExamplesService } from '@ngrx-io/app/examples/examples.service'; @Component({ selector: 'ngrx-docs-stackblitz', standalone: true, template: ` @if (isEmbedded()) {
} @else { } `, encapsulation: ViewEncapsulation.None, styles: [ ` ngrx-docs-stackblitz iframe { display: block; width: 100%; height: 800px; border: none; } ngrx-docs-stackblitz .stackblitz-link { background: none; border: none; padding: 0; font: inherit; color: var(--ngrx-link); cursor: pointer; } `, ], }) export class StackblitzComponent implements AfterViewInit { examplesService = inject(ExamplesService); platformId = inject(PLATFORM_ID); name = input('__base'); embedded = input('false'); exampleRef = viewChild.required