Tuesday 27 October 2015

Text value in Div using Double Braces in AngularJs

Html Code:
       
<html>
<head>
    <title>Text value in div and span AngularJS</title>
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>

<body>
    <div id="div1" ng-app="">
        <input ng-model="name" type="text" /><span ng-bind="240- name.length + ' char remaining .'"></span>
        <div>
{{name}}</div>
or
        <div ng-bind="name">
</div>
</div>
</body>
</html>
       

Example & OutPut:


{{name}}
or