title: difference between init function calling from controller initialization and from html page at rendering in angular js
body: <p>what is the difference between init() method calling from controller initialization time and from html page at rendering in angular js ?</p>
  
  <p>html partial:</p>
  
  <pre><code>&lt;div ng-init="init()"&gt;
      ---
      ---
  &lt;/div&gt;
  </code></pre>
  
  <p>controller :</p>
  
  <pre><code>angular.module('masterJs')
      .controller('SignupCtrl', function ($scope, $rootScope) {
  
          $scope.init(){
            //code here
          }
  
      });
  </code></pre>
  
  <p>here i am calling init() method from partial. what is the difference when we call init() from controller not from the html page like:</p>
  
  <pre><code>angular.module('masterJs')
          .controller('SignupCtrl', function ($scope, $rootScope) {
  
              $scope.init(){
                //code here
              }
  
  
            $scope.init();
          });
  </code></pre>