0

I want to show the name of the file when the images are hovered over. This is the current code with the ng-mouseover but it's not working. What am I going wrong?

<div class="row" ng-init="IconTooltip=false">
    <p ng-show="IconTooltip">file: {{kus.text | specialCharClean}}</p>
    <a ng-repeat="kus in tl_kus"  ng-mouseover="IconTooltip=true" ng-mouseleave="IconTooltip=false" ui-sref="app.feedkus({kus:(kus.text|ampToDash)})">
        <img class="img-responsive" src="../images/kusegory-icons/{{kus.text | specialCharClean}}.png" width="30">
    </a>
</div>
Elaine Byene
  • 3,868
  • 12
  • 50
  • 96

2 Answers2

1

About isolated scope of ng-repeat: Directive isolate scope with ng-repeat scope in AngularJS

Example of getting stuff out of that isolated scope and showing on hover https://plnkr.co/edit/fquwzjmIKGKUzgnfvkSA?p=preview

<ul>
  <li ng-repeat="item in main.items" ng-mouseover="main.showText=true;main.selectedItem = item" ng-mouseleave="main.showText=false;main.selectedItem={}">{{item.text}}</li>
</ul>

<p ng-show="main.showText">Hovering over {{main.selectedItem.id}}</p>
Community
  • 1
  • 1
0

I ended up using a different approach and got it working. Thank you everyone.

<div class="row">
    <p ng-init=hover_kus="text:''">{{hover_kus.text}}</p>
    <a ng-repeat="kus in tl_kus" ng-mouseover="hover_kus.txt=cat.text" ui-sref="app.feedkus({kus:(kus.text|ampToDash)})">
        <img class="img-responsive" src="../images/kusegory-icons/{{kus.text | specialCharClean}}.png" width="30">
    </a>
</div>
Elaine Byene
  • 3,868
  • 12
  • 50
  • 96