Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
{{message}}!
<button ng-click="changeMessage()">change Message</button>
</div>
JavaScript
var myApp = angular.module('myApp',[]);
function MyCtrl($scope, $http) {
$scope.message = 'Hello $scope';
$scope.newMessage = 'Hello World';
$scope.changeMessage = function(){
// if you comment $scope.message, and uncomment 'debugger', then run the // fiddle(with opened console),
// and click the button, and after than write $scope in the console, you'll get // this message:
// Uncaught ReferenceError: $scope is not defined
// but if you uncomment $scope.message, it will work just fine
// and in that case, $scope.newMessage will be accessible
$scope.message = $scope.newMessage;
//debugger;
}
}