title: How can I await in this case?
body: <p>I have a dialogue box having a bunch of different fields in it. For one such field <code>reviewMessage</code>, the text I need to show in it comes from a async call to the backend. Now, the issue I am facing is, while opening the dialogue box, the async call takes time to execute and the dialogue box gets opened first, so the field comes out empty since the async call hasn't completed yet. This is the code:</p>
  <pre><code>$scope.init = function() {
          if (!reviewable) {
            $scope.suggestionIsRejected = (
              $scope.activeSuggestion.status === 'rejected');
            if ($scope.suggestionIsRejected) {
              _getThreadMessagesAsync($scope.activeSuggestionId);
            }
          }
      }
  
    const _getThreadMessagesAsync = function(threadId) {
      return ThreadDataBackendApiService.fetchMessagesAsync(
        threadId).then((response) =&gt; {
        const threadMessageBackendDicts = response.messages;
        $scope.reviewMessage = threadMessageBackendDicts.map(
          m =&gt; ThreadMessage.createFromBackendDict(m))[1].text;
      });
    };
  </code></pre>
  <p>It's the field called <code>scope.reviewMessage</code> which turns out to be empty. I want that this field gets loaded first before the dialogue box gets opened. How can I do this?</p>