Created
January 22, 2015 13:46
-
-
Save thaenor/13cb4587235dad931db1 to your computer and use it in GitHub Desktop.
Angular with simple controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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