<html>
<head>
<script src="angular.js"></script>
</head>
<body>
<div ng-app="">
</div>
</body>
</html>
<html>
<head>
<script src="angular.js"></script>
</head>
<body>
<div ng-app="">
Hello {{name}}
</div>
</body>
</html>
<html>
<head>
<script src="angular.js"></script>
</head>
<body>
<div ng-app="">
Hello {{name}}, you're {{70 + 11}} years old.
</div>
</body>
</html>
<div ng-app=""> <div ng-controller="FirstCtrl"> Hello {{name}}, you're {{age + 11}} years old.
</div>
</div>
var FirstController = function($scope) {
$scope.name = 'Ronen';
$scope.age = 70;
}
<div ng-app=""> <div ng-controller="FirstCtrl"> <input type="text" ng-model="age" /> Hello {{name}}, you're {{age + 11}} years old.
</div>
</div>
var FirstController = function($scope) {
$scope.name = 'Ronen';
$scope.age = 70;
}
<div ng-app=""> <div ng-controller="FirstCtrl"> <input type="text" ng-model="age" /> Hello {{name}}, you're {{age + 11}} years old.
<button ng-click="sayMyName()">Say my name!</button>
</div>
</div>
var FirstController = function($scope) {
$scope.name = 'Ronen';
$scope.age = 70;
$scope.sayMyName = function() {
alert($scope.name);
};
}