title: Angular view not updated following changes to OnPush Component created through ViewContainerRef
body: <p>Using Angular 4.3 and the following <a href="https://plnkr.co/edit/KmVjhVqMwa6yJIortf5u?p=preview" rel="nofollow noreferrer">Plunkr</a>.</p>
  
  <p>Please consider the following components:</p>
  
  <pre><code>@Component({
    selector: 'my-app',
    template: `
      &lt;div&gt;
        &lt;button type="button" (click)="toggle()"&gt;Toggle&lt;/button&gt;
        &lt;div #anchor&gt;&lt;/div&gt;
      &lt;/div&gt;
    `,
    changeDetection: ChangeDetectionStrategy.OnPush
  })
  export class App {
    @ViewChild('anchor', {read: ViewContainerRef}) anchor: ViewContainerRef;
    dynamicRef: ComponentRef;
    value = true;
  
    constructor(private cfr: ComponentFactoryResolver, private cdr: ChangeDetectorRef) {}
  
    ngAfterViewInit(): void {
      let factory = this.cfr.resolveComponentFactory(Dynamic);
      this.dynamicRef = this.anchor.createComponent(factory);
      this.dynamicRef.instance.value = this.value;
      this.dynamicRef.changeDetectorRef.detectChanges();
    }
  
    toggle(): void {
      this.value = !this.value;
      this.dynamicRef.instance.value = this.value;
      this.dynamicRef.changeDetectorRef.detectChanges();
    }
  }
  
  @Component({
    template: `Value: {{value}}`,
    changeDetection: ChangeDetectionStrategy.OnPush
  })
  export class Dynamic {
    @Input() value = true;
  }
  </code></pre>
  
  <p>The <code>App</code> component creates the <code>Dynamic</code> component using the standard <code>ComponentFactoryResolver</code> + <code>ViewContainerRef</code> strategy. Both components have an <code>OnPush</code> change detection strategy. When the <code>App.toggle()</code> method is called, it toggles <code>App.value</code>, propagates this new value to <code>Dynamic.value</code> and forces a change detection run on the dynamic component's change detector.  I expect the correct value to be displayed by the dynamic component's template, but it actually never changes.  Switching both components to the <code>Default</code> change detection strategy provides the expected behaviour.</p>
  
  <p>Why isn't the dynamic component template re-rendered properly and how can this be fixed?</p>