 
 BlazeComponent.register 'FooComponent', FooComponent
 
+class @SelfRegisterComponent extends BlazeComponent
+  # Alternative way of registering components.
+  @register 'SelfRegisterComponent'
+
 class SubComponent extends MainComponent
   @calls: []
 

      top: '42'

    @assertEqual @trim(output), @trim """
      <p>Main component: MainComponent</p>
      <button>Foo1</button>
      <p>MainComponent/MainComponent.foobar/{"top":"42"}/{"top":"42"}/MainComponent</p>
      <button>Foo2</button>
      <p>MainComponent/MainComponent.foobar2/{"top":"42"}/{"a":"1","b":"2"}/MainComponent</p>
      <p>MainComponent/MainComponent.foobar3/{"top":"42"}/{"top":"42"}/MainComponent</p>
      <p>Subtemplate</p>
      <button>Foo1</button>
      <p>MainComponent/MainComponent.foobar/{"top":"42"}/{"top":"42"}/MainComponent</p>
      <button>Foo2</button>
      <p>MainComponent/MainComponent.foobar2/{"top":"42"}/{"a":"3","b":"4"}/MainComponent</p>
      <p>MainComponent/MainComponent.foobar3/{"top":"42"}/{"top":"42"}/MainComponent</p>
      #{ FOO_COMPONENT_CONTENT }
      <hr>
      #{ SUB_COMPONENT_CONTENT }
    """

    componentTemplate = BlazeComponent.getComponentTemplate 'FooComponent'

    output = Blaze.toHTMLWithData componentTemplate,
      top: '42'

    @assertEqual @trim(output), @trim COMPONENT_CONTENT 'SubComponent'

  testGetComponent: =>
    @assertEqual BlazeComponent.getComponent('MainComponent'), MainComponent
