title: proper way of calling the functions during init in JavaScript
body: <p>I am getting error method1 () is undefined. What is the proper way to invoke a method during init?</p>
  
  <pre><code> gdmsDashboard.controller('DashboardController', '$scope') {
  
          $scope.Msg = "";
  
          (function init() {
              $scope.method1 ();
              method1 ();
              this.method1 ();
  
          })();
  
          $scope.method1 = function () { 
            //
          }
  }
  </code></pre>