ng-tags-input, how to disable user input?

拈花ヽ惹草 提交于 2019-12-14 03:47:03

问题


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


  1. Removing Close/remove Tag symbol :
    a) Search for ng-click="$removeTag()" ng-bind="::$$removeTagSymbol"
    b) Delete these attributes

  2. Making Tags Read only :
    a) Search for <input class="input"
    b) Add readonly attribute

  3. Removing "Add a tag" placeholder :
    a) Search for Add a tag, you will see something like placeholder:[String,"Add a tag"]
    b) Replace it with empty string , something like this placeholder:[String,""]

Screenshot



来源:https://stackoverflow.com/questions/34509624/ng-tags-input-how-to-disable-user-input

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!