Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda