code: function() {
              var n_components = 0;
              var componentRendered = _.bind(function() {
                  n_components = n_components + 1;
                  if (n_components >= this.countComponents) {
                      this.ready();
                  }
              }, this);
  
              if (_.size(this.components) == 0) { this.ready(); return this; }
  
              var addComponent = _.bind(Q.fbind(function(component) {
                  this.$("component[data-component='"+component.cid+"']").replaceWith(component.$el);
                  component.defer(_.once(componentRendered));
  
                  return Q.try(function() {
                      component.update();
                  }).fail(function(err) {
                      logging.exception(err, "Error rendering component:");
                  })
              }), this);
  
              _.each(this.components, function(value, cid) {
                  if (_.isArray(value)) {
                      _.each(value, addComponent);
                  } else {
                      addComponent(value);
                  }
              });
  
              this.trigger("components:render");
              return this;
          }
docs: /*
  Add components to elements