Skip to content

bug: $ionicSlideBoxDelegate.currentIndex return object #3260

Closed

Description

@ag-secret

Type: bug

Platform: desktop browser

I have a slidebox with events values from a webservice. On event afterEnter I'm refreshing the events from slidebox and updating, so when I call the currentIndex I'm getting an object or something like that.

    $scope.events = [];
$scope.$on('$ionicView.afterEnter', function(){
    $scope.firstRefresh();
});

$scope.firstRefresh = function(){
    $scope.showFirstRefresh = true;
    $timeout(function(){
        Evento.get()
            .then(function(result){
                $scope.events = result;
                $ionicSlideBoxDelegate.update();
                    console.log($ionicSlideBoxDelegate.currentIndex); <--- HERE
            }, function(err){

            })
            .finally(function(){
                $scope.showFirstRefresh = false;
            });
    }, 1000);
};

What I'm getting on Chrome console:

  function caller() {
      var handle = this.handle;
      var args = arguments;
      var foundInstancesCount = 0;
      var returnValue;

      this._instances.forEach(function(instance) {
        if ((!handle || handle == instance.$$delegateHandle) && instance.$$filterFn(instance)) {
          foundInstancesCount++;
          var ret = instance[methodName].apply(instance, args);
          //Only return the value from the first call
          if (foundInstancesCount === 1) {
            returnValue = ret;
          }
        }
      });

      if (!foundInstancesCount && handle) {
        return $log.warn(
          'Delegate for handle "' + handle + '" could not find a ' +
          'corresponding element with delegate-handle="' + handle + '"! ' +
          methodName + '() was not called!\n' +
          'Possible cause: If you are calling ' + methodName + '() immediately, and ' +
          'your element with delegate-handle="' + handle + '" is a child of your ' +
          'controller, then your element may not be compiled yet. Put a $timeout ' +
          'around your call to ' + methodName + '() and try again.'
        );
      }
      return returnValue;
    }</span>

Activity

  1. ajoslin commented on Apr 14, 2015

    @ajoslin
    Contributor

    $ionicSlideBoxDelegate.currentIndex() is a function you have to call. It returns a number.

  2. locked and limited conversation to collaborators on Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions