# SlideBox : GetByHandle not working in modal

**URL:** <https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590>\
**Category:** ionic-v1\
**Created:** [December 4, 2014, 9:42am UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590 "2014-12-04T09:42:30Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![WidawskiJ](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/widawskij/32/7606_2.png) [@WidawskiJ](https://forum.ionicframework.com/u/WidawskiJ)\
**Post date:** [December 4, 2014, 9:42am UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/1 "2014-12-04T09:42:30Z")

</div>

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

> **[Tabs And Navigation: Nightly](https://codepen.io/prettyGoodPancakes/pen/pvjByY)**
>
> Demo showing how each tab has its own history stack. Navigating between each tab remembers the correct back and forward views that were visited. Forke...

Thanks a lot to all of you

---

<div class="post-metadata">

**Author:** ![colm](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@colm](https://forum.ionicframework.com/u/colm)\
**Post date:** [December 4, 2014, 10:46am UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/2 "2014-12-04T10:46:05Z")

</div>

same issue for me. +1

---

<div class="post-metadata">

**Author:** ![colm](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@colm](https://forum.ionicframework.com/u/colm)\
**Post date:** [December 4, 2014, 11:38pm UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/3 "2014-12-04T23:38:56Z")

</div>

> **[Modal: Nightly](https://codepen.io/Colm/pen/azveGB)**
>
> Demo of an Ionc slide up modal. Forked from \[Ionic\](http://codepen.io/ionic/)'s Pen \[Modal: Nightly\](http://codepen.io/ionic/pen/gblny/)....

I have this working for me now.

---

<div class="post-metadata">

**Author:** ![WidawskiJ](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/widawskij/32/7606_2.png) [@WidawskiJ](https://forum.ionicframework.com/u/WidawskiJ)\
**Post date:** [December 4, 2014, 11:46pm UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/4 "2014-12-04T23:46:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![adam](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/adam/32/63947_2.png) [@adam](https://forum.ionicframework.com/u/adam)\
**Post date:** [December 5, 2014, 5:54pm UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/5 "2014-12-05T17:54:15Z")

</div>

@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!

---

<div class="post-metadata">

**Author:** ![WidawskiJ](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/widawskij/32/7606_2.png) [@WidawskiJ](https://forum.ionicframework.com/u/WidawskiJ)\
**Post date:** [December 5, 2014, 6:09pm UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/6 "2014-12-05T18:09:06Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![colm](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@colm](https://forum.ionicframework.com/u/colm)\
**Post date:** [December 7, 2014, 9:12pm UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/7 "2014-12-07T21:12:46Z")

</div>

> **[Modal: Nightly](https://codepen.io/Colm/pen/azveGB)**
>
> Demo of an Ionc slide up modal. Forked from \[Ionic\](http://codepen.io/ionic/)'s Pen \[Modal: Nightly\](http://codepen.io/ionic/pen/gblny/)....

@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);
> }
> );
```

---

<div class="post-metadata">

**Author:** ![wedgybo](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/wedgybo/32/64033_2.png) [@wedgybo](https://forum.ionicframework.com/u/wedgybo)\
**Post date:** [December 7, 2014, 9:55pm UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/8 "2014-12-07T21:55:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![claw](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/claw/32/7636_2.png) [@claw](https://forum.ionicframework.com/u/claw)\
**Post date:** [December 7, 2014, 10:23pm UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/9 "2014-12-07T22:23:24Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![colm](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@colm](https://forum.ionicframework.com/u/colm)\
**Post date:** [December 9, 2014, 12:37am UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/10 "2014-12-09T00:37:12Z")

</div>

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

Many thanks!

---

<div class="post-metadata">

**Author:** ![julianpaulozzi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/julianpaulozzi/32/71205_2.png) [@julianpaulozzi](https://forum.ionicframework.com/u/julianpaulozzi)\
**Post date:** [January 17, 2015, 10:19pm UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/11 "2015-01-17T22:19:32Z")

</div>

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");
 }
```

---

<div class="post-metadata">

**Author:** ![edolix](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/edolix/32/74807_2.png) [@edolix](https://forum.ionicframework.com/u/edolix)\
**Post date:** [May 12, 2015, 7:58am UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/12 "2015-05-12T07:58:52Z")

</div>

Same issue with RC.5.

Look at this codepen:  
[http://codepen.io/anon/pen/jPWomG](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!

---

<div class="post-metadata">

**Author:** ![tuckerjt07](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tuckerjt07](https://forum.ionicframework.com/u/tuckerjt07)\
**Post date:** [June 28, 2015, 10:31pm UTC](https://forum.ionicframework.com/t/slidebox-getbyhandle-not-working-in-modal/13590/13 "2015-06-28T22:31:31Z")

</div>

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.
