Closed oriolpuig closed 7 years ago
hi! @oriolpuig it seems like this might be caused because jQuery has not been loaded properly with angular.
@oriolpuig I had same issue, this is what helped:
window.$ = window.jQuery = require('jquery');
var angular = require('angular');
require('slick-carousel');
require('slick-carousel/slick/ajax-loader.gif');
require('slick-carousel/slick/slick.css');
require('slick-carousel/slick/slick-theme.css');
require('angular-slick-carousel');```
Hi @bkraszewski and @t4r0,
Thanks for your comments. At the end, I added the jQuery and slick.js script references into intex.html and this will be packaged in the bundle.js with grunt.
<!-- build:js({.tmp,.}) app.js -->
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../node_modules/slick-carousel/slick/slick.min.js"></script>
<script src="bundle.js"></script>
<!-- endbuild -->
Best regards,
Awesome @devmark I think you can close this issue
I've done all of this and I still get the error.
@adamcolejenkins could you provide more information on how your project is set?
nothing is working everyday i hare angular more and more
Hi @devmark,
I've been looking in all the issues if anyone could help me but I didn't find one to solve my problem. That's why I open a new one and apologize me if i'm wrong.
I've an angular aplication loaded with Grunt and using browserify to solve the dependencies and I've the require('angular-slick-carousel') at the top of the main angular app module and at the end I inject the 'slickCarousel' as a dependency injection.
First, I tried with something like this:
module.exports = angular.module('mainApp', [ 'slickCarousel' ])
My component is using the same logic than your plunker's and It's not working fine.
module.exports = { template: require('./Carousel.tpl.html'), controller: CarouselController, bindings: { carouselId: '@', carouselConfig: '<', fireChangeSlide: '&onChangeSlide' } };
/ @ngInject / function CarouselController($timeout) { var ctrl = this;
}