dgeni-alive
Version:
Live doc generator on top of Dgeni
77 lines (69 loc) • 2.31 kB
HTML
{% include "lib/macros.html" -%}
{% extends "api/api.template.html" %}
{% block additional %}
<h2>Directive Info</h2>
<ul>
{% if doc.scope %}<li>This directive creates new scope.</li>{% endif %}
<li>This directive executes at priority level {$ doc.priority $}.</li>
{% if doc.multiElement %}<li>This directive can be used as {@link $compile#-multielement- multiElement}</li>{% endif %}
</ul>
{% block usage %}
<h2 id="usage">Usage</h2>
<div class="usage">
{% if doc.usage %}
{$ doc.usage | marked $}
{% else %}
<ul>
{% if doc.restrict.element %}
<li>as element:
{% if doc.name.indexOf('ng') == 0 -%}
(This directive can be used as custom element, but be aware of <a href="guide/ie">IE restrictions</a>).
{%- endif %}
{% code %}
<{$ doc.name | dashCase $}
{%- for param in doc.params -%}
{# skip attribute with name equal to directive name #}
{%- if (doc.name != param.alias and doc.name != param.name) %}
{$ directiveParam(param, '="', '"') $}
{%- endif -%}
{%- endfor %}>
...
</{$ doc.name | dashCase $}>
{% endcode %}
</li>
{% endif -%}
{%- if doc.restrict.attribute -%}
<li>as attribute:
{% code %}
<{$ doc.element $}
{%- for param in doc.params %}
{$ directiveParam(param, '="', '"', false, doc.name) $}
{%- endfor %}>
...
</{$ doc.element $}>
{% endcode %}
</li>
{% endif -%}
{%- if doc.restrict.cssClass -%}
<li>as CSS class:
{% code %}
{% set sep = joiner(' ') %}
<{$ doc.element $} class="
{%- for param in doc.params -%}
{$ sep() $}{$ directiveParam(param, ': ', ';', true) $}
{%- endfor %}"> ... </{$ doc.element $}>
{% endcode %}
</li>
{% endif -%}
{%- endif %}
</div>
{% endblock -%}
{%- if doc.animations %}
<h2 id="animations">Animations</h2>
{$ doc.animations | marked $}
{$ 'module:ngAnimate.$animate' | link('Click here', doc) $} to learn more about the steps involved in the animation.
{%- endif -%}
{% include "lib/params.template.html" %}
{% include "lib/events.template.html" %}
{% include "lib/throws.template.html" %}
{% endblock %}