title: Dynamically adding tags in AngularJS
body: <p>all:</p>
  
  <p>Is there a way to dynamically add a tag (especially a custom tag) in AngularJS?</p>
  
  <p>I have a custom tag recently created of the type: </p>
  
  <pre><code>&lt;mytag type="small" /&gt;
  </code></pre>
  
  <p>which I am attempting to manage in a larger &lt;div> element. What I would like to do is place, within the div element, a button that, when pressed, causes the creation of a new mytag element within the div.</p>
  
  <p>In other words, given an initial page composition:</p>
  
  <pre><code>&lt;div ng-controller="tagControl"&gt;
     &lt;div id="tagdiv"&gt;
        &lt;mytag type="small" /&gt;
     &lt;/div&gt;
     &lt;div id="Controls"&gt;
        &lt;button ng-click="addTag()"&gt;Add New Tag&lt;/button&gt;
        &lt;button ng-click="clearTags()"&gt;Clear All Tags&lt;/button&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I would like to put something in the tagControl's addTag() function that adds a new mytag tag whenever the "Add New Tag" button is pressed, and I'd like to put something in the clearTags() function that removes all added tags when the "Clear All Tags" button is pressed.</p>
  
  <p>Is this possible using AngularJS? If not, can it be accomplished using a third- party library? In either event, how can this be done?</p>
  
  <p>Thanks in advance for any insights...</p>