Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

owl.carousel.js:1658 Uncaught TypeError: Cannot read property 'fn' of undefined #3

Closed
rainstormza opened this issue Feb 28, 2017 · 5 comments

Comments

@rainstormza
Copy link

rainstormza commented Feb 28, 2017

owl.carousel.js:1658 Uncaught TypeError: Cannot read property 'fn' of undefined
at owl.carousel.js:1658
at Object. (owl.carousel.js:1695)
at webpack_require (bootstrap 2c4170b…:52)
at Object.Owl.Defaults.items (index.js:18)
at webpack_require (bootstrap 2c4170b…:52)
at Object.433 (main.ts:11)
at webpack_require (bootstrap 2c4170b…:52)
at Object.434 (app.component.ts:17)
at webpack_require (bootstrap 2c4170b…:52)
at Object.324 (src async:7)
at webpack_require (bootstrap 2c4170b…:52)
at Object.553 (main.bundle.js:181)
at webpack_require (bootstrap 2c4170b…:52)
at webpackJsonpCallback (bootstrap 2c4170b…:23)
at main.bundle.js:1
(anonymous) @ owl.carousel.js:1658
(anonymous) @ owl.carousel.js:1695
webpack_require @ bootstrap 2c4170b…:52
Owl.Defaults.items @ index.js:18
webpack_require @ bootstrap 2c4170b…:52
433 @ main.ts:11
webpack_require @ bootstrap 2c4170b…:52
434 @ app.component.ts:17
webpack_require @ bootstrap 2c4170b…:52
324 @ src async:7
webpack_require @ bootstrap 2c4170b…:52
553 @ main.bundle.js:181
webpack_require @ bootstrap 2c4170b…:52
webpackJsonpCallback @ bootstrap 2c4170b…:23
(anonymous) @ main.bundle.js:1

lastest version still error like this

Edit : import jquery

@rainstormza
Copy link
Author

2wkpl2n

but there is no carousel

my code

html

<owl-carousel [options]="{items: 3, dots: false, navigation: false}" [items]="images" [carouselClasses]="['owl-theme', 'row', 'sliding']">
<div class="item" *ngFor="let image of images;let i = index">
<div class="thumbnail-image" [ngStyle]="">

typescript

import { Component, ViewChild } from '@angular/core';
import {OwlCarousel} from 'ng2-owl-carousel';

@component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
@ViewChild('owlElement') owlElement: OwlCarousel

images: Array = [0,1,2,3,4,5,6,7,8,9,10];

fun() {
this.owlElement.next([200])
//duration 200ms
}
}

@mujtaba01
Copy link
Owner

Update scripts key in your angular-cli.json to include jQuery

"scripts": [
"../node_modules/jquery/dist/jquery.js"
]

http://ayoubgdah.com/blog/using-jquery-with-angular-2-angular-cli/

@rainstormza
Copy link
Author

1488276937209

error was gone but data doesn't look like what I expect
Is this about owl carousel css file ?

@mujtaba01
Copy link
Owner

Yes you need to include owl carousel css file.

@amitgaur208
Copy link

This issue not solved for me..

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants