Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
267 views
in Technique[技术] by (71.8m points)

angularjs directive - How to find an attribute's (which is binded in HTML code) source library in angular?

Basically I have below code snippet in Angular in one of component's HTML code:

<span 
[attr.data-tooltip]="skuDetails.name" ?
[autoClose]="true" 
data-tooltip-position="top" ?
ngbTooltip="{{skuDetails.name}}">{{skuDetails.value}}
</span>

I am not able to find which angular library uses this directive/attribute data-tooltip or data-tooltip-position or ngbTooltip.

There are just lots of libraries with similar names and just difficult to figure out from which angular library or dependency this attribute is coming from. Is there any way to find this and just install this library to make this code work in another angular project.

question from:https://stackoverflow.com/questions/66058642/how-to-find-an-attributes-which-is-binded-in-html-code-source-library-in-angu

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is html5 specification: https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes.

<style type="text/css">
    [data-tooltip]::after {
        content: attr(data-tooltip);
    }
    [data-tooltip]::after {
        opacity: 0;
    }
    [data-tooltip]::after {
      transition: 2s;
    }       
    [data-tooltip]::after {
      pointer-events: none;
    }
    [data-tooltip]:hover::after {
      opacity: 0.8;
    }
</style>

<p data-tooltip="message">Test</p>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...