title: Call function into another function with in the same Controller Angular Js
body: <p>I am new to using angularjs and i have declared a two functions in controller, and now i want to use one function into another function how can i do that 
  means if i say function name into another function it says Undefined.</p>
  
  <p>here is the code: </p>
  
  <pre><code>'use strict';
  angular.module('customer').controller('Controller', ['$scope', '$state', 'Sservice',
    function($scope, $state, Sservice) {
  
      var that = this;
  
      (function getDetails() {
          //IMPLEMENTATION
      }());
  
      this.function2 = function function2 (id){
          //implementation
        getDetails(); // says undefined
      };
    }
  ]);
  </code></pre>