I parse my data using d3 and a call back function and use a select tag and ng-options to create a dropdown. The problem is the callback function does not finish before the page loads. 

Thus, how can I solve this problem of using callback function inside a controller?

For more clarification, if I have a dataset outside the callback function this works and fills my ng-options perfectly.