code: function waitForRender() {
              var deferredRender = $q.defer();
              function wait() {
                if ($element.find("table:visible").length === 0) {
                  $timeout(wait, 100);
                } else {
                  deferredRender.resolve();
                }
              }
  
              $timeout(wait);
              return deferredRender.promise;
            }
docs: Set fixed widths for the table headers in case the text overflows. There's no callback for when rendering is complete, so check the visibility of the table periodically -- see http://stackoverflow.com/questions/11125078