javascript - How to change the route when an element is hovered over? -
i know ng-mouse=ng-href...
not proper syntax, it's trying do. how can change href
when mouse hovers on element?
<ul id="optionslist"> <li ng-repeat="link in links"> <a ng-mouse=ng-href="#/{{link.linkname}}" /> <div class="hvr-bubble-right">{{link.linkname}}</div> </a> </li> </ul>
one way like:
ng-mouseover="yourfunction(link.linkname)"
and in controller:
$scope.yourfunction=function(where){ $window.location.href = where; //or $state.go('some.state'); if use states. }
remember include '$window' or '$state' in controller depending on use.
Comments
Post a Comment