MCPcopy Create free account
hub / github.com/angular/angular / Preview

Class Preview

adev/src/app/editor/preview/preview.component.ts:30–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 imports: [PreviewError],
29})
30export class Preview {
31 private readonly domSanitizer = inject(DomSanitizer);
32 private readonly nodeRuntimeSandbox = inject(NodeRuntimeSandbox);
33 private readonly nodeRuntimeState = inject(NodeRuntimeState);
34
35 loadingProgressValue = this.nodeRuntimeState.loadingStep;
36 protected loadingEnum = LoadingStep;
37
38 readonly previewUrl = toSignal(this.nodeRuntimeSandbox.previewUrl$, {initialValue: null});
39 protected readonly previewUrlForIFrame = computed(() => {
40 const url = this.previewUrl();
41 return url !== null ? this.domSanitizer.bypassSecurityTrustResourceUrl(url) : null;
42 });
43
44 protected readonly bootPoseSrc = computed(() => {
45 const pose = BOOT_POSES[this.loadingProgressValue() as LoadingStep] ?? 'greeting';
46 return `${ANGIE_DIR}/${pose}.svg`;
47 });
48}

Callers

nothing calls this directly

Calls 4

injectFunction · 0.90
toSignalFunction · 0.90
computedFunction · 0.90

Tested by

no test coverage detected