var DialogController = function ($scope, configFac, $q) {
var placeholders = [];
var varInit = function () {
$q.all([configFac]).then(function (response) {
$scope.configResources = response[0];
placeholders[0] = response[0].one;
placeholders[1] = response[0].two;
placeholders[2] = response[0].three;
});
};
var states = {
'initial': {
'key': 'initial',
'inputPlaceholder': placeholders[0],
'avatar': {
'state': 'default'
}
},
'editing': {
'key': 'editing',
'inputPlaceholder': placeholders[1],
'avatar': {
'state': 'listening'
}
},
'answered': {
'key': 'answered',
'inputPlaceholder': placeholders[2],
'avatar': {
'state': 'thinking-complete'
}
}
};
)};
When executing this code in my project, the input placeholders are not getting set because the promise is taking too long to return. Is there a way to make it wait for the response? Alternatively, I have introductory code running at the start of the project. Is there a method to trigger this function from a different module while that initial code is running?