Last active
March 2, 2016 20:52
-
-
Save julienroubieu/c676946019581d44ec7c to your computer and use it in GitHub Desktop.
Fix for $ionicScrollDelegate not working in modals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# The original Ionic $ionicScrollDelegate does not work for views in modals. | |
# This decorator fixes the issue by getting the handle globally instead of from the active scope. | |
# https://github.com/driftyco/ionic/issues/2754 | |
# | |
$ionicScrollDelegateDecorator = ($provide) -> | |
decorateService = ($delegate) -> | |
$delegate.$getByHandle = (name) -> | |
instances = this._instances | |
_.where(instances, '$$delegateHandle': name)[0] | |
$delegate | |
decorateService.$inject = ['$delegate'] | |
$provide.decorator '$ionicScrollDelegate', decorateService | |
$ionicScrollDelegateDecorator.$inject = ['$provide'] | |
angular | |
.module('jroubieu') | |
.config($ionicScrollDelegateDecorator) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment