Manesh Golekar

Manesh Golekar

  • NA
  • 444
  • 13k

using Scope in Angular JS and html5

Jan 12 2015 5:36 AM
Can someone plz help with below sample for using scope in AngularJS . JS file is in same directory .


<!doctype html>
<html ng-app>
<head>
<script type="text/javascript" src="angular.js"></script> 


</head>
<body>

<input type="text" ng-model="myname" />
 
<hr/>
 Hello {{myname}} !  

<hr/>

<div ng-controller="GreetCtrl">

Hello {{name}} !

</div>

<script type="text/javascript">

function GreetCtrl($scope){
$scope.name = 'Manesh';

}

</script>

</body>
</html>

Answers (1)