I want to use $ionicScrollDelegate.$getByHandle(‘xxx’).getScrollPosition().top within the Controller of a Modal window.
Whenever I use this command, following error appears :
ionic.bundle.js:26794 Delegate for handle “xxx” could not find a corresponding element with delegate-handle=“xxx”! getScrollPosition() was not called!
Possible cause: If you are calling getScrollPosition() immediately, and your element with delegate-handle=“xxx” is a child of your controller, then your element may not be compiled yet. Put a $timeout around your call to getScrollPosition() and try again.
Can anyone tell me how I can use $ionicScrollDelegate.$getByHandle within a modal window ?
What is the exact use case? Are you calling this method during initialization of your controller? Then try putting a $timeout around your call (as suggested by the error message).
Also keep in mind that $ionicScrollDelegate only works for ion-content and ion-scroll elements.
Within the controller of this modal I want have function “checkScroll” which is activated whenver the user scrolls the ion-scroll. In this function I want to use :