title: TypeError: Cannot read property 'next' of undefined in AngularJS
body: <p>HTML:</p>
  
  <pre><code>&lt;a href="#" ng-click="next()" class="timeline-right-arrow" tabindex="0"&gt;
      &lt;i class="timeline-right-arrow-icon"&gt;&lt;/i&gt;
    &lt;/a&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>$scope.next = function () {
    $scope.timeLineScroll.next();
  };
  
  $scope.prev = function () {
    $scope.timeLineScroll.prev();
  };
  </code></pre>
  
  <p>When I click <code>next</code> get this error:</p>
  
  <pre><code>TypeError: Cannot read property 'next' of undefined
      at Scope.$scope.next (TimelineController.js:139)
      at $parseFunctionCall (angular.js:12404)
      at angular-touch.js:472
      at Scope.$get.Scope.$eval (angular.js:14466)
      at Scope.$get.Scope.$apply (angular.js:14565)
      at HTMLAnchorElement.&lt;anonymous&gt; (angular-touch.js:471)
      at HTMLAnchorElement.jQuery.event.dispatch (jquery.js:3074)
      at HTMLAnchorElement.jQuery.event.add.elemData.handle (jquery.js:2750)
  </code></pre>
  
  <p>TimelineController.js 139.line</p>