mujtaba01 / ngx-owl-carousel

An angular2 (4) wrapper for jquery owl-carousel library with dynamic carousel item change detection
MIT License
70 stars 25 forks source link

ERROR DOMException: Failed to execute 'setAttribute' on 'Element': '--' #9

Closed NayHaPal closed 7 years ago

NayHaPal commented 7 years ago

when i print owl-carsourl component in my html file

` <owl-carousel [options]="{items: 3, dots: false, navigation: false}"

    [items]="images"
    <!-- classes to be attached along with owl-carousel class -->
    [carouselClasses]="['owl-theme', 'row', 'sliding']">
    <div class="item" *ngFor="let image of images;let i = index">
      <div class="thumbnail-image"
           [ngStyle]="{'background': 'url('adsf.jpg')no-repeat scroll center center / 80px 80px'}">
      </div>
    </div>
    </owl-carousel>`

the error is


MenuComponent.html:22 ERROR CONTEXT DebugContext_ {view: Object, nodeIndex: 23, nodeDef: Object, elDef: Object, elView: Object}
View_MenuComponent_0 @ MenuComponent.html:22
proxyClass @ compiler.es5.js:14091
DebugContext_.logError @ core.es5.js:12947
ErrorHandler.handleError @ core.es5.js:1149
(anonymous) @ core.es5.js:4660
ZoneDelegate.invoke @ zone.js:381
onInvoke @ core.es5.js:4125
ZoneDelegate.invoke @ zone.js:380
Zone.run @ zone.js:141
(anonymous) @ zone.js:805
ZoneDelegate.invokeTask @ zone.js:414
onInvokeTask @ core.es5.js:4116
ZoneDelegate.invokeTask @ zone.js:413
Zone.runTask @ zone.js:181
drainMicroTaskQueue @ zone.js:574
zone.js:630 Unhandled Promise rejection: Failed to execute 'setAttribute' on 'Element': '--' is not a valid attribute name. ; Zone: <root> ; Task: Promise.then ; Value: DOMException: Failed to execute 'setAttribute' on 'Element': '--' is not a valid attribute name.
    at EmulatedEncapsulationDomRenderer2.DefaultDomRenderer2.setAttribute (http://localhost:4200/vendor.bundle.js:30160:16)
    at DebugRenderer2.setAttribute (http://localhost:4200/vendor.bundle.js:13389:23)
    at createElement (http://localhost:4200/vendor.bundle.js:9541:22)
    at createViewNodes (http://localhost:4200/vendor.bundle.js:12140:44)
    at callViewAction (http://localhost:4200/vendor.bundle.js:12552:13)
    at execComponentViewsAction (http://localhost:4200/vendor.bundle.js:12491:13)
    at createViewNodes (http://localhost:4200/vendor.bundle.js:12209:5)
    at callViewAction (http://localhost:4200/vendor.bundle.js:12552:13)
    at execComponentViewsAction (http://localhost:4200/vendor.bundle.js:12491:13)
    at createViewNodes (http://localhost:4200/vendor.bundle.js:12209:5) Error: Failed to execute 'setAttribute' on 'Element': '--' is not a valid attribute name.
    at EmulatedEncapsulationDomRenderer2.DefaultDomRenderer2.setAttribute (http://localhost:4200/vendor.bundle.js:30160:16)
    at DebugRenderer2.setAttribute (http://localhost:4200/vendor.bundle.js:13389:23)
    at createElement (http://localhost:4200/vendor.bundle.js:9541:22)
    at createViewNodes (http://localhost:4200/vendor.bundle.js:12140:44)
    at callViewAction (http://localhost:4200/vendor.bundle.js:12552:13)
    at execComponentViewsAction (http://localhost:4200/vendor.bundle.js:12491:13)
    at createViewNodes (http://localhost:4200/vendor.bundle.js:12209:5)
    at callViewAction (http://localhost:4200/vendor.bundle.js:12552:13)
    at execComponentViewsAction (http://localhost:4200/vendor.bundle.js:12491:13)
    at createViewNodes (http://localhost:4200/vendor.bundle.js:12209:5)
api.onUnhandledError @ zone.js:630
handleUnhandledRejection @ zone.js:654
_loop_1 @ zone.js:645
api.microtaskDrainDone @ zone.js:649
drainMicroTaskQueue @ zone.js:582
zone.js:632 Error: Uncaught (in promise): InvalidCharacterError: Failed to execute 'setAttribute' on 'Element': '--' is not a valid attribute name.
Error: Failed to execute 'setAttribute' on 'Element': '--' is not a valid attribute name.
    at EmulatedEncapsulationDomRenderer2.DefaultDomRenderer2.setAttribute (platform-browser.es5.js:2849)
    at DebugRenderer2.setAttribute (core.es5.js:13178)
    at createElement (core.es5.js:9330)
    at createViewNodes (core.es5.js:11929)
    at callViewAction (core.es5.js:12341)
    at execComponentViewsAction (core.es5.js:12280)
    at createViewNodes (core.es5.js:11998)
    at callViewAction (core.es5.js:12341)
    at execComponentViewsAction (core.es5.js:12280)
    at createViewNodes (core.es5.js:11998)
    at EmulatedEncapsulationDomRenderer2.DefaultDomRenderer2.setAttribute (platform-browser.es5.js:2849)
    at DebugRenderer2.setAttribute (core.es5.js:13178)
    at createElement (core.es5.js:9330)
    at createViewNodes (core.es5.js:11929)
    at callViewAction (core.es5.js:12341)
    at execComponentViewsAction (core.es5.js:12280)
    at createViewNodes (core.es5.js:11998)
    at callViewAction (core.es5.js:12341)
    at execComponentViewsAction (core.es5.js:12280)
    at createViewNodes (core.es5.js:11998)
    at resolvePromise (zone.js:757)
    at zone.js:683
    at zone.js:699
    at ZoneDelegate.invoke (zone.js:381)
    at Zone.run (zone.js:141)
    at zone.js:805
    at ZoneDelegate.invokeTask (zone.js:414)
    at Zone.runTask (zone.js:181)
    at drainMicroTaskQueue (zone.js:574)
    at <anonymous>
api.onUnhandledError @ zone.js:632
handleUnhandledRejection @ zone.js:654
_loop_1 @ zone.js:645
api.microtaskDrainDone @ zone.js:649
drainMicroTaskQueue @ zone.js:582```
enesr commented 7 years ago

Remove the HTML comments and it should work.