DashboardController = function($scope, syncService, lovefieldService) {
  this.scope_ = $scope;
  this.lovefieldService_ = lovefieldService;

  this.testSuites = [];
  this.logger = console['log'].bind(console);

  this.lovefieldService_.getDbConnection().then(function() {
    // Draw initially with data from the database.
    this.redraw_();

    // Get notified when new data has been synced.
    this.lovefieldService_.whenLastSyncDateChanged(function() {
      this.logger('New data found, redrawing...');
      this.redraw_();
    }.bind(this));

    // Spawn server sync.
    this.logger('Syncing with server...');
    syncService.init();

  }.bind(this));

  this.viewMap_ = buildViewMap();
}
@param {!angular.Scope} $scope
@param {!SyncService} syncService
@param {!LovefieldService} lovefieldService
@constructor