ng-swippy | Tinder-like card directive for Angular | Ecommerce library
kandi X-RAY | ng-swippy Summary
kandi X-RAY | ng-swippy Summary
Tinder-like card directive for Angular
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Convert touch and touch event coordinates .
- Extract events events from pointers .
ng-swippy Key Features
ng-swippy Examples and Code Snippets
Community Discussions
Trending Discussions on ng-swippy
QUESTION
I have 2 elements that are bound to a click function inside a directive using Angular.
The problem I'm having is when one of those elements are are clicked very quickly, the other element would fire. You can see an example here: http://430designs.com/xperience/black-label-app/deck.php
If you click the "X" several times, rapidly, you'll see the heart glow instead of the "X". You may have to do it a few times to actually see it happen, but it will happen.
I need to disable the heart/dislike buttons after the click and then reenable them when the function is finished.
Here's my controller code. The directive for the "fake swipe" starts on line 87:
...ANSWER
Answered 2017-Jan-07 at 15:02The general principle is this: The first thing you do when you handle the click event is set some boolean to true, e.g. $scope.actionInProgress = true
. On your button you should have the attribute ng-disabled="!actionInProgress"
. Then when you action completes you simply set $scope.actionInProgress = false
.
People answering questions on StackOverflow generally don't like doing your work in your codebase. People like answering questions that are reduced to the heart of the problem. I am also one of those people and I am quite certain from the looks of your code you are quite capable of making such a change slight change yourself.
Good luck!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ng-swippy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page