문제

Hover psuedoclass doesn't seem to work with ng-class ... any ideas? Here's a sample:

http://jsfiddle.net/75n6w/11/

<style>
    .orange {color:orange}
    .pointer-hover:hover {
        cursor: hand; cursor: pointer;
    }
</style>
<table ng-app>
    <thead>
        <th></th>
        <th>Orange<br />class</th>
        <th>Rollover<br />psuedoclass</th>
    </thead>
    <tr>
        <td>With class tag</td>
        <td class="orange">Orange</td> 
        <td class="pointer-hover">Hover pointer</td>
    </tr><tr>
        <td>With ng-class tag</td>  
        <td ng-class="{orange: 1==true}">Orange</td>  
        <td ng-class="{pointer-hover: 1==true}">Hover pointer</td>
    </tr>
</table>
도움이 되었습니까?

해결책

Take a look at console, you have an error. Just wrap your class name with apostrophes:

"{'pointer-hover': 1==true}"

Updated fiddle: http://jsfiddle.net/75n6w/12/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top