Thursday 5 November 2015

Expression in angularJs Example


       
<html>

<head>
    <title>Arithmetic expression in angularjs</title>
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>

<body>

    <span>
        It is used to bind data in html and perform more operation like Arithmetic or string operation. We use expression inside
        Double Braces. As for example {{some expression}}.
    </span>
    <div id="div1" ng-app="">
       
        <input id="idprice" type="text" ng-model="price"    /><br/>
        Numbers & expression
        <div>5% of {{price}} = {{price* 5/100}}</div> 

        strings & expression
        <div>{{'price is :' + price}} </div> 



    </div>


   
</body>
</html>