-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Closed
Milestone
Description
Instead of only supporting touch/click events with a fixed behavior the directives could also support other gestures and broadcast them to the corresponding controller.
I said could because I'm not sure what potential drawbacks all those event listeners and broadcast messages could have.
To give a practical example, I am currently using the following directive to allow hold gestures for my tabs.
module.directive('ionTabControllerItem', ['$rootScope', '$ionicGesture', function($rootScope, $ionicGesture) {
return {
priority: -10,
restrict: 'E',
require: '^ionTabs',
compile: function(element, attr, transclude) {
return function link(scope, element, attrs, tabsCtrl) {
$ionicGesture.on('hold', function(e) {
$rootScope.$broadcast('tab.hold', scope.$index);
}, element);
};
}
};
}]);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels