title: how can i call one function from another function in same controller in angularjs?
body: <p>I tried to call one function from another function but I got a error which is: </p>
  
  <pre><code>2angular.js:9193 Error: [$interpolate:interr] http://errors.angularjs.org/1.2.3/$interpolate/interr?p0=%0A%20%20%20%20%0A…()%7D%7D%0A%0A%20%20&amp;p1=TypeError%3A%20undefined%20is%20not%20a%20function
  </code></pre>
  
  <p>i Write following code in html file </p>
  
  <pre><code>&lt;div ng-app="myApp"&gt;
  
      &lt;div ng-controller="SomeController"&gt;
  
       {{ini()}}
  
    &lt;div id='bar' &gt;
  &lt;div id='slider'&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And my controller looks like:</p>
  
  <pre><code>var myApp = angular.module("myApp", []);
  myApp.controller("SomeController", function($scope) {
  
      $scope.bar =document.getElementById('bar');
      $scope.slider =document.getElementById('slider');
      $scope.info = document.getElementById('info');
      $scope.set_per="";
      $scope.ini = function() {
          $scope.bar.addEventListener('mousedown', $scope.startSlide(), false);   
          $scope.bar.addEventListener('mouseup', $scope.stopSlide(), false);
      }
  
      $scope.startslide=function(event){
  
          $scope.set_perc = ((((event.clientX - $scope.bar.offsetLeft) / $scope.bar.offsetWidth)).toFixed(2));
          info.innerHTML = 'start' + $scope.set_perc+ '%';    
          $scope.bar.addEventListener('mousemove', $scope.moveSlide(bar,slider,info), false); 
          $scope.slider.style.width = ($scope.set_perc * 100) + '%';  
       }
  
      $scope.moveSlide=function(event){
          $scope.set_perc = ((((event.clientX - $scope.bar.offsetLeft) / $scope.bar.offsetWidth)).toFixed(2));
          $scope.info.innerHTML = 'moving : ' + $scope.set_perc + '%';
          $scope.slider.style.width = ($scope.set_perc * 100) + '%';
      }
  
      $scope.stopSlide=function(event){
          $scope.set_perc = ((((event.clientX - $scope.bar.offsetLeft) / $scope.bar.offsetWidth)).toFixed(2));
          $scope.info.innerHTML = 'done : ' + $scope.set_perc + '%';
          $scope.bar.removeEventListener('mousemove', $scope.moveSlide(bar,slider,info), false);
          $scope.slider.style.width = ($scope.set_perc * 100) + '%';
      }
  
  });
  </code></pre>