Comments (14)
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.
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.
mind creating a jsfiddle for this? i can easier see what's not working.
from angular-flippy.
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.
I just tried it. It didn't work. How could I include the plugin in jsfiddle?
from angular-flippy.
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.
Sorry. I couldn't get the jsfiddle to work. What other information you want to look at?
from angular-flippy.
@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.
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.
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.
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.
@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.
perfect works like a charm...thanks
from angular-flippy.
I think we should close this issue, thank you Zwacky
from angular-flippy.
Related Issues (15)
- Merge PRs to fix your bower mainfile HOT 1
- Gulp Inject Error HOT 6
- Angular 2? HOT 1
- Trigger flip with ngSwipeLeft / ngSwipeRight HOT 2
- Canvas Image HOT 11
- In Firefox flippy-front part does not render correctly HOT 12
- When I set overflow: auto for flippy-front it shows in the Flippy back in reverse HOT 4
- Trying to push branch for pull request HOT 1
- Custom Method for flippy with unique id HOT 2
- Flippy element height HOT 6
- Multiple Flippie's on page they overlap HOT 6
- Flip effect does not work on Internet Explorer 11 HOT 6
- iOS behaviour broken HOT 2
- Suggestion: Play with CSS pointer events could allow for directive to be triggered by inner elements HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-flippy.