Topic: mdbModal gives an error
                  
                  duong do
                  free
                  asked 7 years ago
                
Dear supporter,
We are using mdbModal for displaying some messages. However we get the following error:
TypeError: Cannot read property 'backdrop' of undefined
AppComponent.html:37
message:"Cannot read property 'backdrop' of undefined"
ngDebugContext:DebugContext_ {view: Object, nodeIndex: 15, nodeDef: Object, …}
ngErrorLogger:function () { … }
stack:"TypeError: Cannot read property 'backdrop' of undefinedn at ModalDirective.showBackdrop (webpack-internal:///../../../../ng-mdb-pro/free/modals/modal.directive.ts:213:42)n at ModalDirective.show (webpack-internal:///../../../../ng-mdb-pro/free/modals/modal.directive.ts:122:14)n at ActivityCreateComponent.set [as show] (webpack-internal:///../../../../../src/app/activity-create/activity-create.component.ts:110:41)n at updateProp (webpack-internal:///../../../core/esm5/core.js:12826:37)n at checkAndUpdateDirectiveInline (webpack-internal:///../../../core/esm5/core.js:12533:19)n at checkAndUpdateNodeInline (webpack-internal:///../../../core/esm5/core.js:14100:20)n at checkAndUpdateNode (webpack-internal:///../../../core/esm5/core.js:14043:16)n at debugCheckAndUpdateNode (webpack-internal:///../../../core/esm5/core.js:14936:76)n at debugCheckDirectivesFn (webpack-internal:///../../../core/esm5/core.js:14877:13)n at Object.eval [as updateDirectives] (ng:///AppModule/AppComponent.ngfa...
__proto__:Error {constructor: , name: "TypeError", message: "", …}
We look into the code and see that it uses "this.config.backdrop" when this.config is undefined.
rule 259 of modal.directive.ts
if (this._isShown && this.config.backdrop && (!this.backdrop || !this.backdrop.instance.isShown)) {
Is it a well-known error?
Regards,
Duong
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
              Opened
Specification of the issue
              - ForumUser: Free
 - Premium support: No
 - Technology: MDB Angular
 - MDB Version: -
 - Device: -
 - Browser: -
 - OS: -
 - Provided sample code: Yes
 - Provided link: No
 
Tags
                  
Damian Gemza staff commented 7 years ago
Dear Duong, This isn't a known error for us. Could you provide me some reproduction steps? Could you try to try catch this block of code? Maybe it will help. Best Regards, Damian