Search code examples
angularjstwitter-bootstrapng-tags-input

ng-tags-input custom template not working


I am experiencing some troubles trying to get ng-tags-input to work. I am trying to a custom template for my tags, and my code is barely what the developers show in the demos. Everything works fine, except for the fact that my custom template is ignored (see the code below ). Am I missing anything trivial? Why are tags still shown with the default template?

Background: App built in Angular (with routing), and Bootstrap. The code below is in one of Angular views.

Code:

 <div class="form-group">
      <label for="tags">Tags</label>
      <tags-input ng-model="tags" name="tags"
                        display-property="name"
                        id="tags"
                        template="tagtemplate">
          <auto-complete source="loadTags($query)"></auto-complete>
      </tags-input>

      <script type="text/ng-template" id="tagtemplate">
              <div class="tag-template">
                <span class="label label-info tag">
                  {{$getDisplayText()}}
                  <a class="remove-button" ng-click="$removeTag()">&#10006;</a>
                </span>
              </div>
      </script>
 </div>

Solution

  • Then then answer is @MichaelBenford's comment. The code works fine with version 2.3.0.