mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs(docs-infra): show usageNotes only for methods. (#57343)
Prior to this change, function and methods showed their usage notes which resulted in duplicate displays for functions. Fixes #57339 PR Close #57343
This commit is contained in:
parent
4b04a0e61a
commit
e404f88092
2 changed files with 6 additions and 3 deletions
|
|
@ -35,7 +35,7 @@ export function ClassMember(props: {member: MemberEntryRenderable}) {
|
|||
{isClassMethodEntry(props.member) ? (
|
||||
props.member.signatures.map((sig, i, signatures) => {
|
||||
const renderableMember = getFunctionMetadataRenderable(sig);
|
||||
return <ClassMethodInfo entry={renderableMember} isOverloaded={signatures.length > 1} />;
|
||||
return <ClassMethodInfo entry={renderableMember} options={{showUsageNotes: true}} />;
|
||||
})
|
||||
) : (
|
||||
<div className={REFERENCE_MEMBER_CARD_ITEM}>
|
||||
|
|
|
|||
|
|
@ -17,13 +17,16 @@ import {PARAM_KEYWORD_CLASS_NAME, REFERENCE_MEMBER_CARD_ITEM} from '../styling/c
|
|||
import {DeprecatedLabel} from './deprecated-label';
|
||||
import {Parameter} from './parameter';
|
||||
import {RawHtml} from './raw-html';
|
||||
import { EntryType } from '../entities';
|
||||
|
||||
/**
|
||||
* Component to render the method-specific parts of a class's API reference.
|
||||
*/
|
||||
export function ClassMethodInfo(props: {
|
||||
entry: FunctionSignatureMetadataRenderable;
|
||||
isOverloaded?: boolean;
|
||||
options?: {
|
||||
showUsageNotes?: boolean,
|
||||
}
|
||||
}) {
|
||||
const entry = props.entry;
|
||||
|
||||
|
|
@ -47,7 +50,7 @@ export function ClassMethodInfo(props: {
|
|||
<span className={PARAM_KEYWORD_CLASS_NAME}>@returns</span>
|
||||
<code>{entry.returnType}</code>
|
||||
</div>
|
||||
{entry.htmlUsageNotes ? (
|
||||
{entry.htmlUsageNotes && props.options?.showUsageNotes ? (
|
||||
<div className={'docs-usage-notes'}>
|
||||
<span className={PARAM_KEYWORD_CLASS_NAME}>Usage notes</span>
|
||||
<RawHtml value={entry.htmlUsageNotes} />
|
||||
|
|
|
|||
Loading…
Reference in a new issue