Understand AngularJS Controller