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
Post a Comment