Comments (7)
After testing some more I found out the ng-click is in fact NOT disabled. The issue is accessing the outer scope which has the definition of the click function. Since the SLICK directive creates its own scope the outer scope is never reached. So the question is how to access to outer (parent) scope, similar to defining the 'data' attribute. Any help would be appreciated.
from angular-slick.
Not sure if it will work, but you could try placing the function inside a model on the scope instead of on the scope directly. So instead of:
$scope.myfunction = function () {....}
You could try something like:
var myfunction = function () {....};
$scope.myobject = { clicked: myfunction };
Again, I haven't exactly tried this, it's just a suggestion
from angular-slick.
I was able to resolve this by passing the scope to slick as the data attribute. This allowed me to access multiple properties of the scope, including functions and model objects.
// 'this' is a reference to $scope
<slick data=this>
<div ng-click="data.clickHandler()">{{data.model}}</div>
<slick>
from angular-slick.
A good thing you are not working with dynamic data then xD
from angular-slick.
This hack doesn't work with dynamic data. Neither does adding function to the object.
from angular-slick.
@jhjwind I think I worked with something similar. I'll see if I can find a working bit of code later on and post it some time today
from angular-slick.
Check my answer for Angular use-case:
http://stackoverflow.com/questions/29101254/angularjs-slick-js-carousel-ng-click-not-firing-with-responsive-attribute-settin/30584787#30584787
from angular-slick.
Related Issues (20)
- slick execution in ng-repeat HOT 2
- Unslick failure
- Can't swipe back with swipe to slide HOT 1
- Slide when number of slide is less than or equal to slides-to-show HOT 2
- Using boolean('false') always returns true HOT 1
- useCSS property does not work
- Bug doesnt display anything until autoplay begins HOT 1
- slides to scroll setting is not working in last page
- As-nav-for is not working with touch.
- Dragging makes my list disappear HOT 3
- angular slick carousel does not respect viewBox of the ng-md-icon
- ng-click on mobile dont work HOT 1
- Can't disable draggable property
- how to ban cycle?
- how to init current-index
- Cannot read property 'add' of null
- slider.unslick is not a function
- Dragend triggers click
- Passing Slick as dependency with ng-route does not load it HOT 2
- $ is not a function
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-slick.