This will most certainly NOT work with Angular 2+. From the documentation:
AngularJS directive for Swing: A swipeable cards interface. The swipe-left/swipe-right for yes/no input. As seen in apps like Jelly and Tinder, and many others.
It is specifically for AngularJS, as in Angular 1.x. This can be confirmed by looking at the source code. It's utilizing $scope
and $apply
as well as syntax for declaring Angular 1.x directives such as link
functions.
function SwingStackController($scope, $element, $attrs, $parse) {
// ...
}
SwingStackController.$inject = ['$scope', '$element', '$attrs', '$parse'];
function swingStack() {
return {
restrict: 'A',
controller: SwingStackController,
}
}
You could instead consider a library such as HammerJS which libraries such as Angular Material 2 use for touch gestures.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.