angular/adev/shared-docs/pipeline/examples/previews/previews.template
Miles Malerba 427bb5ab0a docs: Add back script to generate example previews map (#60778)
Restores the ability to have example components rendered alongside the
code. This functionality was broken a while back by #53511.

To enable the embedded preview for an example, add `preview` and
`path=adev/src/content/expamples/component/to/render.ts` attributes to
the `<docs-code>` or `<docs-code-multifile>` tag.

Tested with one of the accessibility examples and it seems to work now.

PR Close #60778
2025-04-11 17:19:33 -04:00

17 lines
609 B
Text

/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {Type} from '@angular/core';
/**
* Map of the previews components, values are functions which returns the promise of the component type, which will be displayed as preview in the ExampleViewer component.
* Keys has to be equal to paths written down in the docs markdown files.
*/
export const PREVIEWS_COMPONENTS_MAP: Record<string, () => Promise<Type<unknown>>> = {
${previewsComponents}
};