How can I use module in prototype written javascript file?

71 Views Asked by At

When I called this js file I got error that I cant use import into kind of this page,How I can use module file into a written prototype js file?

import * as storeDB from './publish.storedb.js';
import * as connectionString from './publish.connectionstring.js';
function serviceManager() { }
serviceManager.prototype = (function () {
 const _discardProcess = function (processCreationID, DiscardProcessDesc) {
        return new Promise((resolve, reject) => {
            try {
                $.ajax({
                    data: {
                        processCreationID: processCreationID,
                        discardProcessDesc: DiscardProcessDesc
                    },
                    method: 'POST',
                    url: '/Process/DiscardProcess',
                }).done((data) => {
                    if (data['HasError']) {
                        reject({ state: 'error', content: data });
                    }
                    else {
                        resolve({ state: 'done', content: data });
                    }
                }).fail((errorThrown) => {
                    reject({ state: 'fail', content: errorThrown });
                });
            }
            catch (error) {
                reject({ state: 'catch', content: error });
            }
        })
    };
)}();
0

There are 0 best solutions below