sguti/ng2-owl-carousel2

app.module.ts issue

Closed this issue · 3 comments

dgpoo commented

to import lib of node into app.module.ts wrong written like below
import { Ng2OwlCarouselComponent } from "ng2.owl.carousel"

dgpoo commented

still i am getting error below in console:

Uncaught Error: Unexpected directive 'Ng2OwlCarouselComponent' imported by the module 'AppModule'. Please add a @NgModule annotation.
at syntaxError (eval at 348 (vendor.js:334), :1913:34)
at eval (eval at 348 (vendor.js:334), :15617:44)
at Array.forEach ()
at CompileMetadataResolver.getNgModuleMetadata (eval at 348 (vendor.js:334), :15600:49)
at JitCompiler._loadModules (eval at 348 (vendor.js:334), :27045:70)
at JitCompiler.compileModuleAndComponents (eval at 348 (vendor.js:334), :27018:36)
at JitCompiler.compileModuleAsync (eval at 348 (vendor.js:334), :26947:37)
at PlatformRef
.bootstrapModuleWithZone (eval at 0 (vendor.js:7), :4740:25)
at PlatformRef
.bootstrapModule (eval at 0 (vendor.js:7), :4726:21)
at Object.eval (eval at (app.js:1254), :9:53)
at eval (eval at (app.js:1254), :11:30)
at Object. (app.js:1254)
at webpack_require (polyfills.js:53)
at Object. (app.js:2856)
at webpack_require (polyfills.js:53)
at webpackJsonpCallback (polyfills.js:24)
at app.js:1
syntaxError @ VM56848:1913
(anonymous) @ VM56848:15617
CompileMetadataResolver.getNgModuleMetadata @ VM56848:15600
JitCompiler._loadModules @ VM56848:27045
JitCompiler.compileModuleAndComponents @ VM56848:27018
JitCompiler.compileModuleAsync @ VM56848:26947
PlatformRef
.bootstrapModuleWithZone @ core.es5.js?0445:4740
PlatformRef
.bootstrapModule @ core.es5.js?0445:4726
(anonymous) @ main.ts?7d64:10
(anonymous) @ main.ts?7d64:10
(anonymous) @ app.js:1254
webpack_require @ polyfills.js:53
(anonymous) @ app.js:2856
webpack_require @ polyfills.js:53
webpackJsonpCallback @ polyfills.js:24
(anonymous) @ app.js:1

dgpoo commented

issue in html code also
VM69862:1913 Uncaught Error: Template parse errors:
'carousel-item' is not a known element:

  1. If 'carousel-item' is an Angular component, then verify that it is part of this module.

  2. If 'carousel-item' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
    [options]="carouselOptions">

    [ERROR ->]<carousel-item *ngFor="let item of photos">

    :1913:34) at TemplateParser.parse (eval at 348 (vendor.js:334), :13010:19) at JitCompiler._compileTemplate (eval at 348 (vendor.js:334), :27213:39) at eval (eval at 348 (vendor.js:334), :27132:62) at Set.forEach () at JitCompiler._compileComponents (eval at 348 (vendor.js:334), :27132:19) at eval (eval at 348 (vendor.js:334), :27019:19) at Object.then (eval at 348 (vendor.js:334), :1902:148) at JitCompiler._compileModuleAndComponents (eval at 348 (vendor.js:334), :27018:26) at JitCompiler.compileModuleAsync (eval at 348 (vendor.js:334), :26947:37) at PlatformRef_._bootstrapModuleWithZone (eval at 0 (vendor.js:7), :4740:25) at PlatformRef_.bootstrapModule (eval at 0 (vendor.js:7), :4726:21) at Object.eval (eval at (app.js:1254), :9:53) at eval (eval at (app.js:1254), :11:30) at Object. (app.js:1254) at __webpack_require__ (polyfills.js:53) at Object. (app.js:2856) at __webpack_require__ (polyfills.js:53) at webpackJsonpCallback (polyfills.js:24) at app.js:1