as element:
{% code %}
<{$ doc.name | dashCase $}
{%- for param in doc.params %}
{$ lib.directiveParam(param.alias or param.name, param.type, '="', '"') $}
{%- endfor %}>
...
{$ doc.name | dashCase $}>
{% endcode %}
{% endif -%}
{% set hasNameAsParam = false %}
{# when a directive's name is not a parameter (i.e. doesn't take a value),
add the directive name to the list of attributes and/or css classes #}
{%- for param in doc.params %}
{% set hasNameAsParam = true if param.name === doc.name else hasNameAsParam %}
{%- endfor %}
{%- if doc.restrict.attribute -%}
as attribute:
{% code %}
<{$ doc.element $}
{%- if not hasNameAsParam %}
{$ lib.directiveParam(doc.name, {}, '', '') $}
{%- endif -%}
{%- for param in doc.params %}
{$ lib.directiveParam(param.name, param.type, '="', '"') $}
{%- endfor %}>
...
{$ doc.element $}>
{% endcode %}
{% endif -%}
{%- if doc.restrict.cssClass -%}
as CSS class:
{% code %}
{% set sep = joiner(' ') %}
<{$ doc.element $} class="
{%- if not hasNameAsParam -%}
{$ sep() $}{$ lib.directiveParam(doc.name, {}, '', '') $}
{%- endif -%}
{%- for param in doc.params -%}
{$ sep() $}{$ lib.directiveParam(param.name, param.type, ': ', ';') $}
{%- endfor %}"> ... {$ doc.element $}>
{% endcode %}
{% endif -%}
{%- endif %}
{% endblock -%}
{% include "lib/params.template.html" %}
{% include "lib/events.template.html" %}
{%- if doc.animations %}
Animations
{$ doc.animations | marked $}
{$ 'module:ngAnimate.$animate' | link('Click here', doc) $} to learn more about the steps involved in the animation.
{%- endif -%}
{% endblock %}