Last active
August 29, 2015 13:57
-
-
Save duycuong87vn/9813765 to your computer and use it in GitHub Desktop.
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 ng-app> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>AngularJS review</title> | |
</head> | |
<body> | |
<div ng-controller="MyController"> | |
Your name: | |
<input type="text" ng-model="username"> | |
<button ng-click='sayHello()'>greet</button> | |
<hr> | |
{{greeting}} | |
</div> | |
</body> | |
</html> |
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
function MyController($scope) { | |
$scope.username = 'Crunchbang'; | |
$scope.sayHello = function() { | |
$scope.greeting = 'Hello ' + $scope.username + '!'; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment