Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make simple calculator with the help of Angulor JS

    • 0
    • 3
    • 4
    • 1
    • 0
    • 0
    • 0
    • 0
    • 430
    Comment on it

    This Script will helpful to make a simple 'addition' 'subtraction' 'multiplication' 'division' calculator with the help of Angular JS.

    1. <!DOCTYPE html >
    2. <html>
    3. <head>
    4. <title>Angulor Calculator</title>
    5. <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
    6. <link rel="stylesheet" type="text/css" href="css/style.css" media="all">
    7.  
    8. </head>
    9. <body>
    10.  
    11. <div ng-app>
    12. <fieldset>
    13. <h2>Calculator</h2>
    14. <dl>
    15. <dt>First No :</dt>
    16. <dd><input type="text" ng-model="first" /></dd>
    17.  
    18. <dt>Second No :</dt>
    19. <dd><input type="text" ng-model="second" /></dd>
    20.  
    21. <div class="clr"></div>
    22. </dl>
    23. <div class="operations">
    24. <button ng-click="total = first -- second">Add</button> //For addition
    25. <button ng-click="total = first - second">Sub</button> //For subtraction
    26. <button ng-click="total = first * second">Mul</button> //For multiplication
    27. <button ng-click="total = first / second">Div</button> //For division
    28. </div>
    29. <label class="result">Result: {{total}}</label>
    30. </fieldset>
    31. </div>
    32. </body>
    33. </html>

    I hope this script is helpful for you to understand a simple angular JS program.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: