mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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
17 lines
609 B
Text
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}
|
|
};
|