When using custom directive, in which cases would it be better to use attribute instead of element type
<p>From the angularJS docs, it's written that the common case for using element directive </p>

<blockquote>
  <p>is when you are creating a Domain-Specific Language for parts of your template. Use an attribute when you are decorating an existing element with new functionality.</p>
</blockquote>

<p>The documentation gives an example for the element type but not for the attribute type. What does <strong><em>decorating an existing element with new functionality</em></strong> mean? Can someone provide an example?</p>

<p><strong>UPDATE</strong><br/>
I know that syntax for writing a directive.<br/><br/>
The example given in the doc for <em>element</em> is as follows</p>

<blockquote>
  <p>Using an element for the myCustomer directive is clearly the right choice because you're not decorating an element with some "customer" behavior; you're defining the core behavior of the element as a customer component.</p>
</blockquote>

<p>I am looking for a similar example, but for <em>attribute</em>. An example that explains the case when using the custom directive as attribute would be useful.</p>