Git Product home page Git Product logo

Comments (14)

zwacky avatar zwacky commented on September 26, 2024

in theory you should do this:

<flippy
    flip="['click']"
    flip-back="['custom:FLIP_BACK']"
    duration="800"
    timing-function="ease-in-out">
</flippy>

since FLIP_BACK is just an angular broadcast event, you'd need somewhere on your login button:

// in your ctrl
function loginClicked() {
    $rootScope.$broadcast('FLIP_BACK');
}

from angular-flippy.

wenwei63029869 avatar wenwei63029869 commented on September 26, 2024

Hi @zwacky, I did something like

$scope.buttonClicked = function() {
    console.log("click the button")
    $rootScope.$broadcast('FLIP_BACK');
  }

in my conroller. And

<div class="container">
<flippy
  class="fancy"
  flip="['click']"
  flip-back="['custom: FLIP_BACK']"
  duration="800"
  timing-function="ease-in-out">

<flippy-front>
  <img src="http://s.hswstatic.com/gif/buying-house1.jpg" alt="the front" />
</flippy-front>

<flippy-back>
  <span class='flippy-back-word'> flipped </span>
</flippy-back>

It is not working though. Any idea?

from angular-flippy.

zwacky avatar zwacky commented on September 26, 2024

mind creating a jsfiddle for this? i can easier see what's not working.

from angular-flippy.

zwacky avatar zwacky commented on September 26, 2024

just going over it i see that flip-back="['custom: FLIP_BACK']" should be flip-back="['custom:FLIP_BACK']", without the .

otherwise it would listen to the event FLIP_BACK instead of FLIP_BACK. can you check this?

from angular-flippy.

wenwei63029869 avatar wenwei63029869 commented on September 26, 2024

I just tried it. It didn't work. How could I include the plugin in jsfiddle?

from angular-flippy.

zwacky avatar zwacky commented on September 26, 2024

either just copy paste the content from the dist/js/angular-flippy.js directory or maybe better directly hotlink from https://raw.githubusercontent.com/zwacky/angular-flippy/master/dist/js/angular-flippy.js

from angular-flippy.

wenwei63029869 avatar wenwei63029869 commented on September 26, 2024

Sorry. I couldn't get the jsfiddle to work. What other information you want to look at?

from angular-flippy.

zwacky avatar zwacky commented on September 26, 2024

@wenwei63029869 if it's not working, you may also just fork the demo with your use case: http://jsbin.com/kenunu/edit?html,js,output

from angular-flippy.

raymondelferink avatar raymondelferink commented on September 26, 2024

There is a small error in flippy-directive.js. The original code ends up listening for "custom:EVENT" rather than "EVENT".
I have posted a pull request that fixes this:-)

from angular-flippy.

zwacky avatar zwacky commented on September 26, 2024

thanks again @raymondelferink for the fix!
@wenwei63029869 this might have been what you ran into. can you verify with version 2.0.3?
cheers

from angular-flippy.

immortalcy avatar immortalcy commented on September 26, 2024

Based on this matter and in order not to open another post please have a look at this jsbin.

As you can see dynamically assigning the event will not work due to binding way of the variable and the handling of it after.

from angular-flippy.

zwacky avatar zwacky commented on September 26, 2024

@immortalcy there was still an older lib version, got it working here: https://jsbin.com/cohehariho/1/edit?output

also, the html needs to look like this:

<flippy
    class="fancy"
    flip="['custom:FLIP' + ($index+1)]"
    flip-back="['click']"
    duration="800"
    timing-function="ease-in-out">

since flip is interpreted as = in the directive.

from angular-flippy.

immortalcy avatar immortalcy commented on September 26, 2024

perfect works like a charm...thanks

from angular-flippy.

umair321 avatar umair321 commented on September 26, 2024

I think we should close this issue, thank you Zwacky

from angular-flippy.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.