I have a function calling promise from backend.It is a list of emails. What i am trying to is giving button a text according to the number of emails that user have. For example,If there is no email subtext will say you dont have a email add one etc..
return customerEmailService.getEmailList().then(function (emails) {
if (emails.emailList.length === 0) {
button.active = false;
button.subtext = 'Mail Not Found';
if (flowScope.get("emailWihoutDispense")) {
button.onClick = function () {
message.error(mailNotFoundErrorWithoutDispense());
};
}...
button.OnClick is working fine but button.subtext is not seen in the screen and I want to wait this function to show the subtext on the screen.How can i do that?