AngularJS Example

HTML

<div ng-app="">
  <div class="example2" ng-controller="Cntl1">
    Name: <input ng-model="name" type="text"/>
    <button ng-click="w.alert(name)">Greet</button>
  </div>
</div>

CSS

</style> <!-- Ugly Hack due to jsFiddle issue: http://goo.gl/BUfGZ --> 
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
<style>
.ng-invalid { border: 1px solid red; }

JavaScript

function Cntl1($window, $scope){
  $scope.name = 'World';
	$scope.w = $window
}