Skip to content
@ng-doc/app / Class

NgDocDemoFrameComponent

Shows a demo page of the demo application in an iframe, as tall as the demo's content: the demo page reports its height with postMessage, and only messages from this iframe's window and origin are accepted. The iframe is created in the browser after the first render (the server renders a placeholder with a link to the demo page) and loads lazily. Until the demo reports its size, a placeholder tells that it is loading; a demo page that loads without reporting it within 10 seconds is reported as failed, with the link.

Decorators
@Component
Selectors
ng-doc-demo-frame
DeclarationTypeScript
@Component({ … })
export class NgDocDemoFrameComponent { … }

Members

Constructor

1
()
—

Properties

15
background: WritableSignal<string | undefined>
readonly

The background color the demo's page reported, so that the canvas around the iframe can take it when the demo shows a theme of its own.

created: WritableSignal<boolean>
protectedreadonly

Whether the iframe exists: only in the browser, after the first render.

dots: WritableSignal<string | undefined>
readonly

The color of the dots of the demo canvas in the demo's theme, which its page reported.

fill: InputSignal<boolean>
readonly input()

Whether the iframe fills its container instead of taking the demo's height (fullscreen).

fragment: InputSignal<string | undefined>
readonly input()

The URL fragment of the demo page, without #: the state of an isolated playground, and the theme the page shows (~theme=dark). The iframe loads with the fragment it has when the iframe is created; a later fragment replaces the page's location (location.replace), which reloads nothing and adds no history entry.

protectedreadonly

The demo page's URL for the iframe, with the fragment the iframe was created with.

frameTitle: InputSignal<string>
readonly input()required

The accessible title of the iframe.

height: WritableSignal<number | undefined>
readonly

The height the demo reported, in pixels.

playground: InputSignal<boolean>
readonly input()

Whether the page is the page of an isolated playground, which reports the target.

playgroundMessage: OutputEmitterRef<ɵNgDocPlaygroundFrameMessage>
readonly output()

The messages of an isolated playground's page, from this iframe only.

playgroundSilent: OutputEmitterRef<void>
readonly output()

The page of an isolated playground (playground) loaded but sent no message of the playground within 10 seconds, such as a page the build didn't make.

scheme: WritableSignal<string | undefined>
readonly

The color scheme of the demo's page, which the iframe takes: the page is transparent, and a browser paints an opaque backdrop behind an iframe whose color scheme differs from its page's.

src: InputSignal<string>
readonly input()required

The URL of the demo page, relative to the document or absolute on its origin.

state: Signal<"failed" | "loading" | "ready">
readonly

loading until the demo reports its size, then ready; failed when it never does.

protectedreadonly
—
Symbol
Kind
Class
Decorators
@Component
Selectors
ng-doc-demo-frame
Scope
@ng-doc/app
Edit this page