Skip to content

Commit bb0edad

Browse files
JeanMecheAndrewKushnir
authored andcommitted
docs(docs-infra): Add NgModule exports for directives. (angular#58071)
This information is extracted from the @NgModule Jsdoc tag. fixes angular#57906 PR Close angular#58071
1 parent 0eb1c5c commit bb0edad

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

adev/shared-docs/pipeline/api-gen/rendering/templates/tab-description.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,41 @@ import {Fragment, h} from 'preact';
1010
import {DocEntryRenderable} from '../entities/renderables';
1111
import {normalizeTabUrl} from '../transforms/url-transforms';
1212
import {RawHtml} from './raw-html';
13+
import {CodeSymbol} from './code-symbols';
1314

1415
const DESCRIPTION_TAB_NAME = 'Description';
1516

1617
/** Component to render the description tab. */
1718
export function TabDescription(props: {entry: DocEntryRenderable}) {
18-
if (!props.entry.htmlDescription || props.entry.htmlDescription === props.entry.shortHtmlDescription) {
19-
return (<></>);
19+
const exportedBy = props.entry.jsdocTags.filter((t) => t.name === 'ngModule');
20+
if (
21+
(!props.entry.htmlDescription ||
22+
props.entry.htmlDescription === props.entry.shortHtmlDescription) &&
23+
!exportedBy.length
24+
) {
25+
return <></>;
2026
}
2127

2228
return (
2329
<div data-tab={DESCRIPTION_TAB_NAME} data-tab-url={normalizeTabUrl(DESCRIPTION_TAB_NAME)}>
2430
<RawHtml value={props.entry.htmlDescription} />
31+
32+
{exportedBy.length ? (
33+
<>
34+
<hr />
35+
<h2>Exported by</h2>
36+
37+
<ul>
38+
{exportedBy.map((tag) => (
39+
<li>
40+
<CodeSymbol code={tag.comment} />
41+
</li>
42+
))}
43+
</ul>
44+
</>
45+
) : (
46+
<></>
47+
)}
2548
</div>
2649
);
2750
}

0 commit comments

Comments
 (0)