Sammi
Sammi

Reputation: 119

Add tooltips for ng-tagsinput

I have been using ng-tagsinput from benford -> http://mbenford.github.io/ngTagsInput/

I am trying to add tooltips for tags added in input field. This tooltip should show contents of the tag. Can anyone help me to add tooltips for the tag?

Any help is appreciated.

Thank you,

Upvotes: 0

Views: 579

Answers (2)

user4848830
user4848830

Reputation: 819

This is a very old question but a template approach is better. Just use the "template" attribute and add tooltip to your template. Details here: http://mbenford.github.io/ngTagsInput/documentation/guides/custom-templates

Upvotes: 0

Mohammed Gadi
Mohammed Gadi

Reputation: 391

I have made little changes in latest file of ng-tags-input.js and ng-tags-input.min.js that will solve your requirement of tool tip.

I have added ng-attr-title={{$getDisplayText()}} at ngTagsInput/tag-item.html template section in js file. by simply adding title attribute to the span tag will work. This change made for you, but @mbenford the creator of this library may add this as an feature. You can download the file from below links. and you can see the tooltip on tags :)

https://ufile.io/k5v8w - min js

https://ufile.io/sntbh - unminified js

Upvotes: 1

Related Questions