Skip to content Skip to sidebar Skip to footer

How To Add Disabled Attribute To Input Tag With Ngtagsinput?

I have a custom directive that I use to manage user access through my website. I use this to add a 'disabled='disabled'' attribute to html tags. However, when I try to use this wi

Solution 1:

It's currently unsupported, but looks like will be in the next major version (2.3.0): https://github.com/mbenford/ngTagsInput/issues/102

Edit: 2.3.0 is out; see following link for details https://github.com/mbenford/ngTagsInput/blob/master/CHANGELOG.md#features

Solution 2:

I could not find this option in the release 2.3.0, but at least they have enabled the regular disabled attribute. What I have done to hide the remove button and the "Add a tag" input box, was to add a couple of rules in the CSS.

tags-input[disabled].remove-button {
    display: none;
}
tags-input[disabled]input.input {
    display: none;
}

Probably there is a better way to do it, this was the fastest I could find.

Post a Comment for "How To Add Disabled Attribute To Input Tag With Ngtagsinput?"