Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.
This repository was archived by the owner on May 27, 2021. It is now read-only.

ionic-ion-swipe-cards not working #41

@knmohan

Description

@knmohan

Hey,

Here are my controllers
myApp.controller('MyCardsCtrl', function($scope, $http, $ionicSwipeCardDelegate) {

console.log('MyCardsCtrl');

$scope.cards = [];

$scope.addCard = function(img, name) {
var newCard = {image: img, title: name};
newCard.id = Math.random();
$scope.cards.unshift(angular.extend({}, newCard));
};

$scope.addCards = function(count) {
$http.get('http://api.randomuser.me/?results=' + count).then(function(value) {
angular.forEach(value.data.results, function (v) {
$scope.addCard(v.picture.medium, v.email);
});
$scope.showCards = true;
console.log($scope.cards);
});
};

$scope.addCards(1);

$scope.cardSwiped = function(index) {
$scope.addCards(1);
console.log('cardSwiped');
console.log($scope.cards);
};

$scope.cardDestroyed = function(index) {
$scope.cards.splice(index, 1);
};
})

myApp.controller('MyCardCtrl', function($scope, $ionicSwipeCardDelegate) {
$scope.doAnything = function() {
var card = $ionicSwipeCardDelegate.getSwipeableCard($scope);
card.swipe();
};
});

below is my html content

Swipe down for a new card
{{card.title}}
Like Disklike

Need help in fixing the issue. I used the same css mentioned in the https://devdactic.com/swipeable-cards-ionic/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions