rafaelrferreira
2/1/2017 - 2:42 PM

Very Simple Example: https://ngcourse-1.rangle.io/handout/03-javascript/index.html

angular.module('ngcourse')

  .controller('MainCtrl', function($scope) {
    $scope.username = 'alice';
    $scope.numberOfTasks = 0;
  });
  
  This code defines an AngularJS controller called MainCtrl as a part of a module ngcourse. The way it does it may seem counterintuitive at first.