Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
How is the constant being set?

I am trying to understand the following code, but cannot get what exactly the line const ej2_popups_1 = require("@syncfusion/ej2-popups"); is doing? I searched online and found that the require statement is loading a module, but then the question comes up what exactly is the use of const ej2_popups_1 and which object i.e. full name like aaa.bbb.ccd.Dialog it represents.

The reason I need the fully qualified name is because I want to override a method called someMethod in ej2_popups_1.Dialog.prototype.someMethod.

const ej2_popups_1 = require("@syncfusion/ej2-popups");

/**
 * Modal Dialog sample
 */
// Rendering modal Dialog by enabling 'isModal' as true
let dialogObj = new ej2_popups_1.Dialog({
    width: '92%',
    header: 'Software Update',
    content: 'Your current software version is up to date.Your current software version is up to date.Your current software version is up to date.Your current software version is up to date.Your current software version is up to date.Your current software version is up to date.Your current software version is up to date.Your current software version is up to date.Your current software version is up to date.Your current software version is up to date.d ',
    target: document.getElementById('target'),
    isModal: true,
    animationSettings: { effect: 'None' },
    buttons: [{
            click: dlgButtonClick,
            buttonModel: { content: 'OK', isPrimary: true }
        }],
    open: dialogOpen,
    close: dialogClose
});
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In the RequireJS pattern, you don't have to define things as globals, but rather you have two globals: require and define, which let you create and use modules.

from RequireJS docs: https://requirejs.org/docs/api.html#define

A module is different from a traditional script file in that it defines a well-scoped object that avoids polluting the global namespace. It can explicitly list its dependencies and get a handle on those dependencies without needing to refer to global objects, but instead receive the dependencies as arguments to the function that defines the module.

so, this require function does the work of "window" - in that it knows about your other dependencies. and its not as tightly coupled - a variable vs something configurable like a lookup based on a string name of a package/module. the mechanics of how it works are described here as well

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda