Last active
March 2, 2016 20:53
-
-
Save julienroubieu/50fc80f2950919136f71 to your computer and use it in GitHub Desktop.
Fix for $ionicListDelegate 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 $ionicListDelegate 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 | |
# | |
$ionicListDelegateDecorator = ($provide) -> | |
decorateService = ($delegate) -> | |
$delegate.$getByHandle = (name) -> | |
instances = this._instances | |
_.where(instances, '$$delegateHandle': name)[0] | |
$delegate | |
decorateService.$inject = ['$delegate'] | |
$provide.decorator '$ionicListDelegate', decorateService | |
$ionicListDelegateDecorator.$inject = ['$provide'] | |
angular | |
.module('jroubieu') | |
.config($ionicListDelegateDecorator) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment