Monday, 2 November 2015

ng-mouseover

What is ng-mouseover:ng-mouseover used to perform any task on mouse over event..
Description of ng-mouseover:ng-mouseover has 0 priority . perform any particulate task on mouse over..
Syntax of ng-mouseover:
<div ng-mouseover="myfun()"></div>
Or

<div ng-mouseover="msg='This is angularjs example of ng-mouseover"></div>
How to Use ng-mouseover/ng-mouseover Example::
Example1:
<div ng-init="msg='angularjs example'">
    msg1:{{msg}}
    <div ng-mouseover="msg='This is angularjs example of ng-mouseover'">
        msg2:{{msg}}
    </div>
</div>
o/p: msg:angularjs example
  //when ng-mouseover fire
     msg:This is angularjs example of ng-mouseover
Example2:

<div ng-app="webapp">
        <div ng-controller="angularjsexampleCtlr">
            <div>
                Angularjs Example of ng-mouseover
                <br />
                <div ng-init="myexpression='Angularjs Example of ng-mouseover'">
                    Before ng-mouseover fired : {{myexpression}}
                    <div  ng-mouseover="myfun()" />
                    After ng-mouseover fired :{{myexpression}}
                </div>
              </div>
            </div>
        </div>
    </div>
    <script>
        angular.module('webapp',[]).controller('angularjsexampleCtlr', function ($scope, $http) {
            $scope.myfun = function () {
                $scoep.myexpression = 'This is angularjs example of ng-mouseover’;
            }
        });
    </script>

   o/p: Before ng-mouseover fired: Angularjs Example of ng-mouseover.
            After ng-mouseover fired :This is angularjs example of ng-mouseover..

No comments :

Post a comment