Skip to content

Instantly share code, notes, and snippets.

@anantn
Created January 13, 2014 19:38
Show Gist options
  • Save anantn/8406556 to your computer and use it in GitHub Desktop.
Save anantn/8406556 to your computer and use it in GitHub Desktop.
Simple 2-way binding with AngularJS
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.min.js"></script>
</head>
<body ng-app>
<div ng-controller="MyApp">
<input type="text" ng-model="name"/><br/>
<h1 ng-cloak>Hi {{name}}!</h1>
</div>
</body>
<script>
function MyApp($scope) {
$scope.name = "Anant"
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment