Answer the question
In order to leave comments, you need to log in
What is $timeout used for here?
I understand someone else's code and it is not clear why $timeout is used here?
_initThreadId() {
const me = this;
me.threadId = this.dialogs[0].threadId || me.dialogs[0].code;
me.$timeout(function () {
if (me._comeFromFooter()) me.threadId = _.find(me.dialogs, d => d.employeeType === me.employeeType).threadId;
if (me._comeFromRepresentatives()) me.threadId = _.find(me.dialogs, d => d.employeeType === 'CLIENT_MANAGER').threadId;
});
}
_comeFromRepresentatives() {
return angular.isDefined(this.currentUserRepresentative);
}
_comeFromFooter() {
return angular.isDefined(this.employeeType);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question