By P. Maruthi Sharma - 10261A0547
<!DOCTYPE html> <html> <head> <title>Angular JS Demo 1</title> </head> <body> <input type="text" id="input" onchange="onCh()"/> <button onclick="onCh()">Go!</button> <br /> <span id="output"></span> <script type="text/javascript"> function onCh() { document.getElementById("output").innerHTML=document.getElementById("input").value; } </script> </body> </html>
<!DOCTYPE html> <html ng-app> <head> <title>Angular JS Demo 1</title> </head> <body> <input type="text" ng-model="input" /> <br /> {{ input }} <!-- Angular JS File --> <script src="angular.min.js" type="text/javascript"></script> </body> </html>
<!DOCTYPE html> <html> <head> <title>Angular JS Demo 2</title> </head> <body> <ul> <li> Arun </li> <li> Sunny </li> <li> Raghu </li> <li> Sameer </li> </ul> </body> </html>
<!DOCTYPE html> <html ng-app> <head> <title>Angular JS Demo 2</title> </head> <body ng-init="students=['Arun','Sunny','Raghu','Sameer'];"> <ul> <li ng-repeat="name in students">{{name}} </li> </ul> <!-- Angular JS File --> <script src="angular.min.js" type="text/javascript"></script> </body> </html>
<!DOCTYPE html> <html ng-app> <head> <title>Angular JS Demo 3</title> </head> <body> <div ng-controller="StudentsController"> <input tye="text" ng-model="key"> <ul> <li ng-repeat="person in students | filter:key | orderBy: 'city' ">{{person.name}} - {{person.city}}</li> </ul> </div> <!-- Angular JS File --> <script src="angular.min.js" type="text/javascript"></script> <script type="text/javascript"> function StudentsController($scope) { $scope.students = [ {name:"Adam", city:"Chicago"}, {name:"Daniel", city:"New York"}, {name:"Charles", city:"London"}, {name:"Brock", city:"Seattle"}, {name:"Fred", city:"Mumbai"}, {name:"Evans", city:"Los Angeles"}, {name:"Ivan", city:"Paris"}, {name:"Kevin", city:"Moscow"}, {name:"George", city:"Amsterdam"}, {name:"James", city:"Dubai"}, {name:"Sarah", city:"Hyderabad"}, {name:"Oswald", city:"Dublin"}, {name:"Martin", city:"Chennai"}, {name:"Perry", city:"Tokyo"}, {name:"Natalie", city:"New Delhi"}, {name:"Luther", city:"Berlin"} ]; } </script> </body> </html>