Initially, I am facing an issue with Object-Oriented Programming in javascript, and my understanding of it is quite limited. However, I urgently need to resolve this problem...
Currently, I am attempting to utilize a library designed for Bootstrap 3 within Bootstrap 4: https://github.com/nakupanda/bootstrap3-dialog
The error message I encounter is: "Cannot call a class as a function"
Upon reviewing the code, I have made the following observations:
1 - The function classCallCheck is responsible for triggering the error. It appears that it enforces the usage of "new" to instantiate an object and prohibits invoking it as a regular function;
2 - The function createClass is used to construct classes, therefore, the class structure in Bootstrap 4 does not adhere to conventional definitions.
3 - Another function named inherits indicates that the inheritance process is also unconventional.
4 - The library includes the following code snippet to extend the Bootstrap Modal:
var BootstrapDialogModal = function (element, options) {
Modal.call(this, element, options);
};
However, the error "Cannot call a class as a function" is triggered by Modal.call
I believe the underlying issue lies in BootstrapDialogModal inheriting from Modal based on the inheritance conditions set by Bootstrap 3, which are no longer applicable under Bootstrap 4.
Here's a link to the jsfiddle for reference: http://jsfiddle.net/g6nrnvwu/
If anyone has insights on how to address this code issue, your assistance would be greatly appreciated.
Thank you.