Skip to content

Instantly share code, notes, and snippets.

@thaenor
Created January 22, 2015 13:46
Show Gist options
  • Save thaenor/13cb4587235dad931db1 to your computer and use it in GitHub Desktop.
Save thaenor/13cb4587235dad931db1 to your computer and use it in GitHub Desktop.
Angular with simple controller
<!DOCTYPE html>
<html>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<p>Try to change the names.</p>
<div ng-app="" ng-controller="personController">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}
</div>
<script>
function personController($scope) {
$scope.firstName= "John";
$scope.lastName= "Doe";
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment