Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger flip with ngSwipeLeft / ngSwipeRight #18

Closed
awaldron opened this issue Apr 24, 2016 · 2 comments
Closed

Trigger flip with ngSwipeLeft / ngSwipeRight #18

awaldron opened this issue Apr 24, 2016 · 2 comments

Comments

@awaldron
Copy link

I'm interested in using this script on a touchscreen device and trigger the flip using ngTouch events. I'd also like the filp to read the swipe direction and flip accordingly.

I tried including this into the flip attribute but it's not recognizing the swipe (ngTouch is installed)

flip="['click', 'ngSwipeLeft', 'ng-swipe-right']"

Any ideas?

Thanks
Alan

@zwacky
Copy link
Owner

zwacky commented Apr 24, 2016

hey alan, this is because angular-flippy only listens to native javascript events. swiping is an augmented event.

since you have ngTouch added, you could go <div flip="['custom:SWIPE_LEFT]" ng-swipe-left="$ctrl.swipeLeft()"> and in your controller:

function swipeLeft() {
    $rootScope.$broadcast('SWIPE_LEFT');
}

this should work in my head, haven't tried it on actual paper :)
whatcha think? cheers

@zwacky
Copy link
Owner

zwacky commented May 10, 2016

closing due to inactivity.

@zwacky zwacky closed this as completed May 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants