Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Question regarding closure / scoping in callback functions

Hi,

please could anyone explain why the variables sUsername, oModel, sPath, that are not in scope of my callback function for the createBindingContext call? I would expect them to be available as closure variables.

Tags:
replied

I guess the variables are available and have seen at times the debugger just doesn't pick the variables in the closure when it isn't used ! Try doing this,

function fnSuccess(oContext){

     debugger;

     console.log(oModel);

}

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question