title: How to access the "root" ViewContainerRef from a component
body: <p>I am creating a "component factory" to help me create Components dynamically. This factory is used to create Components like; PopOvers, Modals, Overlays etc. </p>
  
  <p>It has a attach method to create Components:</p>
  
  <pre class="lang-js prettyprint-override"><code>attach&lt;T&gt;(component: ComponentType&lt;T&gt;, viewContainerRef: ViewContainerRef): ComponentRef&lt;T&gt; {
      let componentFactory =
          this.componentFactoryResolver.resolveComponentFactory(component);
      let ref = viewContainerRef.createComponent(
          componentFactory,
          viewContainerRef.length,
          viewContainerRef.parentInjector);
  
      return ref;
  }
  </code></pre>
  
  <p>The method accepts the type of the Component I want to create, and what ViewContainer it should be added to.</p>
  
  <p>When calling this method from inside of a Component, I call it with the Components ViewContainer. And this works fine!</p>
  
  <p>But I would like to have the option to specify if the new Component should be created in the "root" ViewContainer ie. the body of the HTML.</p>
  
  <p>Is this possible? I'm really new to Angular2 so maybe I'm really off track and should solve this some other way.</p>