Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Variables in AngularJS expressions

<script src="angular.min.js"></script>
<div ng-app>
  {{ x = 23; y= 19; x + y }}
</div>

We don’t declare them with var as in plain JavaScript because they are actually attributes of the $scope object Angular maintains for us.