SlideBox : GetByHandle not working in modal

Hey guys,

I’m stuck on an issue, and I’m not sure if it’s relative to the nightly build, but I think it worked previously.

I have tabs, and my main tab is a slidebox. Now, one of my tab button, instead of switching to a tab open a modal (think instagram, create modal).

This modal itself contains a slidebox, and this is where I’m stuck : No matter what I do (wrap it with a timeout or else), the $getByHandle always returns undefined.

This is a plunkr showing my issue

Thanks a lot to all of you

1 Like

same issue for me. +1

1 Like

I have this working for me now.

I’m not sure this is the same issue, but I’m glad you figured it out!

PS: @adam or @andy if you could just take a glance at this, it would be really helpful. I’m dead stuck on that

@WidawskiJ Just made a few fixes as of build 853. Please give it a test and let me know how it goes, and thanks for creating the codepen and describing the issue. Thanks!

Thanks a lot @adam, trying it right now. I’ll keep you updated on how it treats me. Thanks a lot for taking care of it!

(Also I had a bug today that took me and my team hours to debug, I’ll shout you a pm with a codepen to know if this is the expected behavior of ionic).

@adam -> wondering if there is a further bug related to this GetByHandle behaviour.

From what I can work out, the slide box widget is having problems matching the active scope. The codepen demonstrates the issue. Wondering is this a bug or my misuse of the slidemenu, tabs and nav-views.

The modal with slide box shows OK, but it cant get the handle on the slidebox correctly.

The below code in slidebox seems to require isActiveScope been true to find a delegate, yet it is always false for me when I click on my modal link…

> var deregister = $ionicSlideBoxDelegate._registerInstance(
>       slideBoxCtrl, attr.delegateHandle, function() {
>         return $ionicHistory.isActiveScope(scope);
>       }
>     );

I’m still seeing this problem in 863 as well.

Me too, even a

$ionicSlideBoxDelegate.select( $ionicSlideBoxDelegate.previous() );

does not work in modals, fired from the underlying controller, defined in the ionModalView.
$ionicSlideBoxDelegate.selected() returns undefined.

@adam My issue seems to be fixed as per commit https://github.com/driftyco/ionic/commit/1a785afb0a0ee6fcee1c281c605c12c53b0d0407

Many thanks!

1 Like

After migration of …13 to …14’m having the same problem in $ionicTabsDelegate.$getByHandle within the modal.

How could I not do without, so resolved:

function _getCreateTicketTabs() {
     return _.find($ionicTabsDelegate._instances, function (tab) {
         return tab.$$delegateHandle === "createTicketTabs-handle";
     });
     // return $ionicTabsDelegate.$getByHandle("createTicketTabs-handle");
 }
1 Like

Same issue with RC.5.

Look at this codepen:
http://codepen.io/anon/pen/jPWomG

I need this modal across all app (so i put it in run function without specific scope) and i want to disable slide at startup.

$getByHandle not work properly and i can’t control slidebox.

Thanks a lot!

I’m having this same issue. I have a slidebox on my page as a thumbnail and am wanting to launch a modal for a full screen photo slidebox. I need to be able to slide the full screen slidebox to the active index of the thumbnail one.

Upon further review it looks as if it is creating a child instance of the delegate for every photo in the slider in the modal. This isn’t an expected behavior is it? The one not in the modal has the same number of photos but only a single delegate instance.