javascript - How to pass 'this' into a Promise without caching outside? -


i have variable called langdataservice.isdataready promise wawiting resolved. upon resolve logic happen. how can pass promise?

langdataservice.isdataready.then(function () {     this.modalon() }); 

i know can cache var self_ = this; i'm curious of other alternatives?

langdataservice.isdataready.then(function () {   this.modalon() }.bind(this)); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -