Skip to content

Commit

Permalink
docs(docs-infra): Add a deprecated label to APIs (angular#50287)
Browse files Browse the repository at this point in the history
This adds a deprecated label next to the other labels on the API pages for methods & properties.

Fixes angular#44265

PR Close angular#50287
  • Loading branch information
JeanMeche authored and sumitparakh committed May 18, 2023
1 parent a6dce6b commit 428917c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions aio/src/styles/2-modules/label/_label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ label.api-status-label {
margin-right: 8px;
font-weight: 500;
text-transform: uppercase;
line-height: initial;

@media screen and (max-width: 600px) {
display: block;
Expand Down
8 changes: 7 additions & 1 deletion aio/tools/transforms/templates/api/lib/memberHelpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h6 class="no-anchor">Throws</h6>
{%- if method.name !== 'constructor' %}
<thead><tr><th>
<div class="with-github-links">
<h3>
<h3 {% if method.deprecated %} class="deprecated-api-item"{% endif %}>
{%- if method.isCallMember %}<i>call signature</i>
{%- elseif method.isNewMember %}<i>construct signature</i>
{%- else %}{$ method.name $}()
Expand All @@ -94,6 +94,9 @@ <h3>
<a href="guide/releases#developer-preview">developer preview</a>
</label>
{% endif %}
{%- if method.deprecated %}
<label class="api-status-label deprecated" title="This API is deprecated">Deprecated</label>
{% endif %}
{$ github.githubLinks(method, versionInfo) $}
</div>
</th></tr></thead>
Expand Down Expand Up @@ -231,6 +234,9 @@ <h2>{$ headingText $}</h2>
<a href="guide/releases#developer-preview">developer preview</a>
</label>
{% endif %}
{%- if property.deprecated %}
<label class="api-status-label deprecated" title="This API is deprecated">Deprecated</label>
{% endif %}

{%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}
<span class='read-only-property'>Read-Only</span>{% endif %}
Expand Down

0 comments on commit 428917c

Please sign in to comment.