shlomiassaf / ngx-modialog

Modal / Dialog for Angular
http://shlomiassaf.github.io/ngx-modialog
MIT License
686 stars 241 forks source link

clicking on backdrop causes an error #77

Closed nadavsinai closed 8 years ago

nadavsinai commented 8 years ago

Hi, I'm using 0.1.7 with angular2.rc.1

I get this when clicking on a backdrop :

VM13183:1 Uncaught ReferenceError: dialog is not defined(…)(anonymous function) @ VM13183:1InjectedScript._evaluateOn @ (program):145InjectedScript._evaluateAndWrap @ (program):137InjectedScript.evaluateOnCallFrame @ (program):151(anonymous function) @ modal-dialog.container.ts:48ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.js:45ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.js:36ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
openedModel
ModalDialogInstance {config: ModalConfig, _resultDeferred: PromiseCompleter, inElement: true}_resultDeferred: PromiseCompleterconfig: ModalConfigdialogClass: "modal-dialog"isBlocking: falsekeyboard: Array[1]size: "sm"__proto__: Objectdestroy: ()inElement: trueresult: ZoneAwarePromise__proto__: Object
browser_adapter.js:86 EXCEPTION: Error in ./ModalBackdrop class ModalBackdrop - inline template:1:0
browser_adapter.js:77 EXCEPTION: Error in ./ModalBackdrop class ModalBackdrop - inline template:1:0BrowserDomAdapter.logError @ browser_adapter.js:77BrowserDomAdapter.logGroup @ browser_adapter.js:87ExceptionHandler.call @ exception_handler.js:57(anonymous function) @ application_ref.js:265schedulerFn @ async.js:123SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:112NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.js:120NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.js:66ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:78NgZone.runGuarded @ ng_zone.js:228outsideHandler @ dom_events.js:20ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:77 ORIGINAL EXCEPTION: TypeError: Cannot read property 'instance' of undefinedBrowserDomAdapter.logError @ browser_adapter.js:77ExceptionHandler.call @ exception_handler.js:66(anonymous function) @ application_ref.js:265schedulerFn @ async.js:123SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:112NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.js:120NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.js:66ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:78NgZone.runGuarded @ ng_zone.js:228outsideHandler @ dom_events.js:20ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:77 ORIGINAL STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.js:77ExceptionHandler.call @ exception_handler.js:69(anonymous function) @ application_ref.js:265schedulerFn @ async.js:123SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:112NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.js:120NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.js:66ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:78NgZone.runGuarded @ ng_zone.js:228outsideHandler @ dom_events.js:20ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:77 TypeError: Cannot read property 'instance' of undefined
    at ModalDialogInstance.dismiss (ModalDialogInstance.js:41)
    at BootstrapModalContainer.onClick (bootstrapModalContainer.js:45)
    at DebugAppView._View_ModalBackdrop0._handle_click_2_1 (ModalBackdrop.template.js:84)
    at view.js:316
    at dom_renderer.js:278
    at dom_events.js:20
    at ZoneDelegate.invoke (zone.js:323)
    at Object.NgZoneImpl.inner.inner.fork.onInvoke (ng_zone_impl.js:45)
    at ZoneDelegate.invoke (zone.js:322)
    at Zone.runGuarded (zone.js:230)BrowserDomAdapter.logError @ browser_adapter.js:77ExceptionHandler.call @ exception_handler.js:70(anonymous function) @ application_ref.js:265schedulerFn @ async.js:123SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:112NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.js:120NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.js:66ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:78NgZone.runGuarded @ ng_zone.js:228outsideHandler @ dom_events.js:20ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:77 ERROR CONTEXT:BrowserDomAdapter.logError @ browser_adapter.js:77ExceptionHandler.call @ exception_handler.js:73(anonymous function) @ application_ref.js:265schedulerFn @ async.js:123SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:112NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.js:120NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.js:66ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:78NgZone.runGuarded @ ng_zone.js:228outsideHandler @ dom_events.js:20ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
browser_adapter.js:77 DebugContext {_view: _View_ModalBackdrop0, _nodeIndex: 2, _tplRow: 1, _tplCol: 0}BrowserDomAdapter.logError @ browser_adapter.js:77ExceptionHandler.call @ exception_handler.js:74(anonymous function) @ application_ref.js:265schedulerFn @ async.js:123SafeSubscriber.__tryOrUnsub @ Subscriber.js:225SafeSubscriber.next @ Subscriber.js:174Subscriber._next @ Subscriber.js:124Subscriber.next @ Subscriber.js:88Subject._finalNext @ Subject.js:128Subject._next @ Subject.js:120Subject.next @ Subject.js:77EventEmitter.emit @ async.js:112NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.js:120NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.js:66ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233NgZoneImpl.runInnerGuarded @ ng_zone_impl.js:78NgZone.runGuarded @ ng_zone.js:228outsideHandler @ dom_events.js:20ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256ZoneTask.invoke @ zone.js:423
zone.js:260 Uncaught EXCEPTION: Error in ./ModalBackdrop class ModalBackdrop - inline template:1:0
ORIGINAL EXCEPTION: TypeError: Cannot read property 'instance' of undefined
ORIGINAL STACKTRACE:
TypeError: Cannot read property 'instance' of undefined
    at ModalDialogInstance.dismiss (http://localhost:8080/assets/js/viewer.js?bde864d35df8bdbb5d03:83901:29)
    at BootstrapModalContainer.onClick (http://localhost:8080/assets/js/viewer.js?bde864d35df8bdbb5d03:84016:63)
    at DebugAppView._View_ModalBackdrop0._handle_click_2_1 (ModalBackdrop.template.js:84:49)
    at http://localhost:8080/assets/js/viewer.js?bde864d35df8bdbb5d03:34469:25
    at http://localhost:8080/assets/js/viewer.js?bde864d35df8bdbb5d03:62412:37
    at http://localhost:8080/assets/js/viewer.js?bde864d35df8bdbb5d03:63143:94
    at ZoneDelegate.invoke (http://localhost:8080/assets/js/viewer.js?bde864d35df8bdbb5d03:20550:30)
    at Object.NgZoneImpl.inner.inner.fork.onInvoke (http://localhost:8080/assets/js/viewer.js?bde864d35df8bdbb5d03:30537:42)
    at ZoneDelegate.invoke (http://localhost:8080/assets/js/viewer.js?bde864d35df8bdbb5d03:20549:36)
    at Zone.runGuarded (http://localhost:8080/assets/js/viewer.js?bde864d35df8bdbb5d03:20457:49)

I'm a little lost with debugging this, thanks for your wonderful work and awesome component!
shlomiassaf commented 8 years ago

I need a way to reproduce this, please provide an example.

nadavsinai commented 8 years ago

I came back to try to reproduce the issue and seen that you made a major bump since then, Amazing frequency of updates in the ng2 ecosystem recently, I will need to refactor my code to adjust to your changes before checking it... you can close the issue for now, thanks for all your hard work