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

What is the purpose of TDCardDelegate ? #43

Open
loicknuchel opened this issue Jan 7, 2015 · 6 comments
Open

What is the purpose of TDCardDelegate ? #43

loicknuchel opened this issue Jan 7, 2015 · 6 comments

Comments

@loicknuchel
Copy link
Contributor

Hi,

I just played with this ion (thanks a lot guys, it's very nice) but can't figure out what is the purpose of TDCardDelegate service.
Regarding to methods name, it seems to be intended to manipulate cards (which would be really nice) but does not seems to work...
Moreover, I don't understant what $scope to pass as argument...

Is there a way to programatically swipe cards left/right ? Like in tinder.

@keithdmoore
Copy link
Contributor

As you might have expected, you can use it to programatically swipe cards. I use it to snap the card back under certain conditions like this:

      var card = TDCardDelegate.getSwipeableCard($scope);
      card.snapBack();

Note: I am using ionic beta 13 currently

@keithdmoore
Copy link
Contributor

Upon upgrading to beta 14, I had to remove my CardCtrl and move the content to my view controller. By doing so I was not able to get the swipeable card.

@m10l
Copy link

m10l commented Feb 13, 2015

I've been taking a look into TDCardDelegate also. Any idea how the snippet below from ionic.tdcards.js works? It doesn't seem to take a parameter.

/**
 * Swipe a card out programtically
 */
swipe: function() {
  this.transitionOut();
}

@keithdmoore
Copy link
Contributor

That is part of the "Card" itself. It is a SwipeableCardView so no param is needed.

@keithdmoore
Copy link
Contributor

Related issue #49

@mediavrog
Copy link

How can the TDCardDelegate functionality be used from outside the element itself? Is there an ionic-way to get the element and call its methods?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants