问题
I'm looking for how to the disable user input for this directive directive, what I want to do is the controller to insert values on certain events happening in the view.
I've went through the API and I didn't really find how to do this.
I've even tried using the disabled attribute
<tags-input ng-model="filterTags" disabled></tags-input>
What happened was the style turned gray, but I could still manually insert values.
回答1:
check this please,
<input ng-disabled="true">
回答2:
In ng-tags-input.min.js
Removing Close/remove Tag symbol :
a) Search forng-click="$removeTag()" ng-bind="::$$removeTagSymbol"
b) Delete these attributesMaking Tags Read only :
a) Search for<input class="input"
b) AddreadonlyattributeRemoving "Add a tag" placeholder :
a) Search forAdd a tag, you will see something likeplaceholder:[String,"Add a tag"]
b) Replace it with empty string , something like thisplaceholder:[String,""]
Screenshot
来源:https://stackoverflow.com/questions/34509624/ng-tags-input-how-to-disable-user-input