1
Reply

using Scope in Angular JS and html5

Manesh Golekar

Manesh Golekar

Jan 12 2015 5:36 AM
649
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)