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

175
Visualizações
How to bind `this` into an function argument

I have search and try few method, like directly using app.shadow.dialogue({...}.bind(this)) but getting this error

Uncaught TypeError: {(intermediate value)(intermediate value)}.bind is not a function

And trying to do this instead

let dialogue = {
  "title": {
    "text": "Kembali ke tes?",
    "description": "Anda memiliki tes yang masih berlangsung"
  },
  "actions": [
    {
      "text": "Ya",
      "class": "bg-safe",
      "icon": "refresh",
      "action": "direct/tes"
    },{
      "text": "Tidak, Lihat Hasil Sebelumnya",
      "class": "bg-danger",
      "icon": "close",
      "action": function() {
        app.shadow.stop();
        this.view();
      }
    }
  ]
};

dialogue.actions[1].action.bind(this);
app.shadow.dialogue(dialogue);

but this.view still not get into scope

Uncaught TypeError: this.view is not a function

Is there a way to make this statement useable inside an object argument?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

may be you can try :

`
"action":()=> {
        app.shadow.stop();
        this.view();
      }`

hope this is useful for you.

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