Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.