title: Generic error: Runtime compiler is not loaded,
body: <p>I am creating a directive in VSCode Editor which loads a html page on specifying a given path:</p>
  
  <p>Below is the code for same:</p>
  
  <pre><code>@Directive({
   selector: 'html-outlet'
  })
  
  export class HtmlOutlet {
   @Input() html: string;
  
   constructor(private vcRef: ViewContainerRef, private compiler: Compiler) { 
  }
  
  ngOnChanges() {
  const html = this.html;
  if (!html) return;
  
  @Component({
      selector: 'dynamic-comp',
      templateUrl: html
  })
  class DynamicHtmlComponent { };
  
  @NgModule({
      imports: [CommonModule],
      declarations: [DynamicHtmlComponent]
  })
  class DynamicHtmlModule { }
  
  this.compiler.compileModuleAndAllComponentsAsync(DynamicHtmlModule)
      .then(factory =&gt; {
          const compFactory = factory.componentFactories.find(x =&gt; x.componentType === DynamicHtmlComponent);
          const cmpRef = this.vcRef.createComponent(compFactory, 0);
      });}}
  </code></pre>
  
  <p>This code used to work perfectly fine untill i upgraded app to angular 6.
  I am getting below error now :</p>
  
  <p>Runtime compiler is not loaded Error stack trace: Error: Runtime compiler is not loaded
      at Le (main.00612d315fe86075b5fb.js:1)
      at t.compileModuleAndAllComponentsAsync</p>
  
  <p>Can i get some help in this</p>