I am very new to AngularJS. I want to display {{Project.inrtcvalue}}
when the mouse is hovered over values. How can I do this in AngularJS?
<table ng-table="tableParams" show-filter="true" class="table" >
<tr ng-class="{'danger': project.rag <= 35, 'warning': project.rag > 35 && project.rag < 70 , 'success': project.rag > 70}" ng-repeat="project in $data">
<td data-title="'PRN'" sortable="'prn'" filter="{'prn': 'text'}">
{{project.prn}}
</td>
</tr>
</table>
So when the user hovers over these <td>
I want to display a value from a controller. How do I do this? What is the best way to do this?
AngularJS ng-mouseover DirectiveThe ng-mouseover directive tells AngularJS what to do when a mouse cursor moves over the specific HTML element. The ng-mouseover directive from AngularJS will not override the element's original onmouseover event, both will be executed.
When you enable Hover Text on your Mac, you can move the pointer over something on the screen — for example, text, an input field, a menu item or a button — and display a high-resolution zoomed version of it in a separate window.
You should simply be able to use the {{variable}}
notation within a HTML title tag.
So something like:
<td title="{{project.inrtcvalue}}">
See this plunkr for an example (Thanks dfsq)
You can use ng-mouseover
and ng-show
directives to accomplish this.Following is the example. Example .Hope it helps to get you started.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With