angularjs - Anular js Using with controllers how to change my div as replaced as another div on mouse over on a button? -


anular js using controllers how change div replaced div on mouse on over button ?

you can use ng-if or ng-show or ng-hide combined events directives ng-mouseover or ng-mouseenter , ng-mouseleave

function supercontroller($scope) {  	$scope.hovered = false;  }    angular.module('myapp', []);  angular      .module('myapp')      .controller('supercontroller', supercontroller)
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>  <div ng-app="myapp">    <div ng-controller="supercontroller s">      <button        ng-mouseover="hovered=true"        ng-mouseleave="hovered=false">hover me</button>      <div ng-if="hovered">shown if hovered</div>      <div ng-if="!hovered">shown if not hovered</div>    </div>  </div>


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -