directive.template.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {% include "lib/macros.html" -%}
  2. {% extends "api/api.template.html" %}
  3. {% block additional %}
  4. <h2>Directive Info</h2>
  5. <ul>
  6. {% if doc.scope %}<li>This directive creates new scope.</li>{% endif %}
  7. <li>This directive executes at priority level {$ doc.priority $}.</li>
  8. </ul>
  9. {% block usage %}
  10. <h2 id="usage">Usage</h2>
  11. <div class="usage">
  12. {% if doc.usage %}
  13. {$ doc.usage | marked $}
  14. {% else %}
  15. <ul>
  16. {% if doc.restrict.element %}
  17. <li>as element:
  18. {% if doc.name.indexOf('ng') == 0 -%}
  19. (This directive can be used as custom element, but be aware of <a href="guide/ie">IE restrictions</a>).
  20. {%- endif %}
  21. {% code %}
  22. <{$ doc.name | dashCase $}
  23. {%- for param in doc.params %}
  24. {$ directiveParam(param.alias or param.name, param.type, '="', '"') $}
  25. {%- endfor %}>
  26. ...
  27. </{$ doc.name | dashCase $}>
  28. {% endcode %}
  29. </li>
  30. {% endif -%}
  31. {%- if doc.restrict.attribute -%}
  32. <li>as attribute:
  33. {% code %}
  34. <{$ doc.element $}
  35. {%- for param in doc.params %}
  36. {$ directiveParam(param.name, param.type, '="', '"') $}
  37. {%- endfor %}>
  38. ...
  39. </{$ doc.element $}>
  40. {% endcode %}
  41. </li>
  42. {% endif -%}
  43. {%- if doc.restrict.cssClass -%}
  44. <li>as CSS class:
  45. {% code %}
  46. {% set sep = joiner(' ') %}
  47. <{$ doc.element $} class="
  48. {%- for param in doc.params -%}
  49. {$ sep() $}{$ directiveParam(param.name, param.type, ': ', ';') $}
  50. {%- endfor %}"> ... </{$ doc.element $}>
  51. {% endcode %}
  52. </li>
  53. {% endif -%}
  54. {%- endif %}
  55. </div>
  56. {% endblock -%}
  57. {%- if doc.animations %}
  58. <h2 id="animations">Animations</h2>
  59. {$ doc.animations | marked $}
  60. {$ 'module:ngAnimate.$animate' | link('Click here', doc) $} to learn more about the steps involved in the animation.
  61. {%- endif -%}
  62. {% include "lib/params.template.html" %}
  63. {% include "lib/events.template.html" %}
  64. {% endblock %}