build(docs-infra): simplify property syntax rendering (#25768)
PR Close #25768
This commit is contained in:
parent
f871fecf66
commit
adbb920ae8
@ -96,7 +96,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.from-constructor, .read-only-property {
|
.from-constructor, .read-only-property, .write-only-property {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
color: $blue;
|
color: $blue;
|
||||||
}
|
}
|
||||||
|
@ -38,14 +38,9 @@ describe('Api pages', function() {
|
|||||||
expect(page.getOverview('type-alias').getText()).toContain('type HttpEvent<T>');
|
expect(page.getOverview('type-alias').getText()).toContain('type HttpEvent<T>');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show readonly properties as getters', () => {
|
|
||||||
const page = new ApiPage('api/common/http/HttpRequest');
|
|
||||||
expect(page.getOverview('class').getText()).toContain('get body: T | null');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not show parenthesis for getters', () => {
|
it('should not show parenthesis for getters', () => {
|
||||||
const page = new ApiPage('api/core/NgModuleRef');
|
const page = new ApiPage('api/core/NgModuleRef');
|
||||||
expect(page.getOverview('class').getText()).toContain('get injector: Injector');
|
expect(page.getOverview('class').getText()).toContain('injector: Injector');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show both type and initializer if set', () => {
|
it('should show both type and initializer if set', () => {
|
||||||
|
@ -34,8 +34,6 @@
|
|||||||
{%- if member.accessibility !== 'public' %}{$ member.accessibility $} {% endif -%}
|
{%- if member.accessibility !== 'public' %}{$ member.accessibility $} {% endif -%}
|
||||||
{%- if member.isAbstract %}abstract {% endif -%}
|
{%- if member.isAbstract %}abstract {% endif -%}
|
||||||
{%- if member.isStatic %}static {% endif -%}
|
{%- if member.isStatic %}static {% endif -%}
|
||||||
{%- if (member.isGetAccessor or member.isReadonly) and not member.isSetAccessor %}get {% endif -%}
|
|
||||||
{%- if member.isSetAccessor and not member.isGetAccessor %}set {% endif -%}
|
|
||||||
<span class="member-name">{$ member.name $}</span>{$ member.typeParameters | escape $}{% if not member.isGetAccessor %}{$ params.paramList(member.parameters, truncateLines) | trim $}{% endif %}
|
<span class="member-name">{$ member.name $}</span>{$ member.typeParameters | escape $}{% if not member.isGetAccessor %}{$ params.paramList(member.parameters, truncateLines) | trim $}{% endif %}
|
||||||
{%- if member.isOptional %}?{% endif -%}
|
{%- if member.isOptional %}?{% endif -%}
|
||||||
{$ params.returnType(member.type) | trim | truncateCode(truncateLines) $}
|
{$ params.returnType(member.type) | trim | truncateCode(truncateLines) $}
|
||||||
@ -192,6 +190,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}<span class='read-only-property'>Read-only.</span>{% endif %}
|
{%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}<span class='read-only-property'>Read-only.</span>{% endif %}
|
||||||
|
{%- if property.isSetAccessor and not property.isGetAccessor %}<span class='write-only-property'>Write-only.</span>{% endif %}
|
||||||
{% if property.shortDescription %}{$ property.shortDescription | marked $}{% endif %}
|
{% if property.shortDescription %}{$ property.shortDescription | marked $}{% endif %}
|
||||||
{$ (property.description or property.constructorParamDoc.description) | marked $}
|
{$ (property.description or property.constructorParamDoc.description) | marked $}
|
||||||
{% if property.constructorParamDoc %} <span class='from-constructor'>Declared in constructor.</span>{% endif %}
|
{% if property.constructorParamDoc %} <span class='from-constructor'>Declared in constructor.</span>{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user