Search This Blog

Pass Parameter value under event in angular JS:-

We can pass param directly under the calling function which will be received by called function:-

<!DOCTYPE html>
    <script src=""> </script>
<div ng-app="myApp" ng-controller="myCtrl" >
<input type="text" ng-model="num" />

<input type="button" value="sq" ng-click="fun('sq')">
<input type="button" value="cube" ng-click="fun('cb')">


<script type="text/javascript">
          $scope.res= eval($scope.num)*eval($scope.num);
          $scope.res= eval($scope.num)*eval($scope.num)* eval($scope.num);





Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post