How to assign max-tag value dynamically?

If I assigned max-tags="1", it works fine, but when I tried to assign dynamically, using max-tags="maxtag()", via the links function, but it shows a red frame for the input window. From the view, I am trying to set the maximum number of tags. Everything works fine, but the input field is red. It is displayed as the following text image. As a warning. How to fix it. enter image description here

Working demo

http://plnkr.co/edit/ooTucE4yqmLwMH9kNkO7?p=preview

<tags-input ng-model="modeldisplay" class="input-md" display-
property="data" on-tag-removed="removedCustomerTag()"
  placeholder="Select a User" on-tag-adding="addSearchedTag()" on-tag-added="tagAdded($tag)"
  enable-editing-last-tag="removedCustomerTag()" replace-spaces-with-dashes="false" max-tags="maxtag()"
  add-from-autocomplete-only="true">
  <auto-complete source="loadTags($query)" min-length="1" load-on-focus="true" load-on-empty="true" 
    max-results-to-show="10"  template="autocomplete.html">
  </auto-complete>
</tags-input>
+4
source share
1 answer

ngTagsInput - DOM, , :

<tags-input ng-model="modeldisplay" max-tags="{{maxtag}}" ...></tags-input>

, , . , ngTagsInput DOM, {{maxtags}} . , , . , , tagsInputConfigProvider :

app.config(function(tagsInputConfigProvider) {
  tagsInputConfigProvider.setActiveInterpolation('tagsInput', { 
    maxTags: true 
  });
});

ngTagsInput.

, Plunker.

+3

All Articles