Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(doc-gen): render @example tag for ngdoc @method #15448

Merged
merged 1 commit into from
Dec 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/config/templates/ngdoc/api/api.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2 id="dependencies">Dependencies</h2>

{% block examples %}
{%- if doc.examples %}
<h2 id="example">Example</h2>
<h2 id="example">Examples</h2>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changes this because all of our headlines are plural, even if there's only one member (Parameters, Methods). I didn't change the id to not break any links.

{%- for example in doc.examples -%}
{$ example | marked $}
{%- endfor -%}
Expand Down
7 changes: 7 additions & 0 deletions docs/config/templates/ngdoc/lib/methods.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ <h4>Returns</h4>
{$ lib.typeInfo(method.returns) $}
{% endif %}

{%- if method.examples %}
<h4 id="{$ doc.name $}.{$ method.name $}-examples">Examples</h4>
{%- for example in method.examples -%}
{$ example | marked $}
{%- endfor -%}
{% endif -%}

</li>
{% endfor -%}
</ul>
Expand Down