title: Angular4/ngrx - ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked
body: <p>In my angular code , the admin page lists items within the data-table component , once one of the data items is clicked , the admin-right component opens and displays data related to the clicked Item. </p>
  
  <p>once clicked I get this error:</p>
  
  <pre><code>ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'false'. Current value: 'true'.
      at viewDebugError (core.es5.js:8434)
      at expressionChangedAfterItHasBeenCheckedError (core.es5.js:8412)
      at checkBindingNoChanges (core.es5.js:8576)
      at checkNoChangesNodeInline (core.es5.js:12448)
      at checkNoChangesNode (core.es5.js:12422)
      at debugCheckNoChangesNode (core.es5.js:13202)
      at debugCheckDirectivesFn (core.es5.js:13104)
      at Object.eval [as updateDirectives] (AdminComponent.html:21)
      at Object.debugUpdateDirectives [as updateDirectives] (core.es5.js:13086)
      at checkNoChangesView (core.es5.js:12242)
  </code></pre>
  
  <p>I started getting the error once I created the admin-right child component</p>
  
  <hr>
  
  <p>admin.component.html:</p>
  
  <pre><code>&lt;data-table [table]='table' [data]="data" (onSelect)="onItemSelect($event)"&gt;&lt;/data-table&gt;
  
  &lt;admin-right *ngIf="showRight"
  [item]="item"
  [rightContent]="rightContent"&gt;&lt;/admin-right&gt;
  </code></pre>
  
  <p>data-table.component.ts:</p>
  
  <pre><code>@Component({
   ...
    changeDetection: ChangeDetectionStrategy.OnPush
  })
  export class DataTableComponent implements OnInit {
  
    constructor(
      private cdRef:ChangeDetectorRef
    ) { } 
    ngOnInit() {
      this.cdRef.detectChanges();
    }
  </code></pre>
  
  <p>right.component.ts:</p>
  
  <pre><code>@Component({
   ....
    changeDetection: ChangeDetectionStrategy.OnPush
  })
  export class RightComponent implements OnInit {
  
    @Input()  item;
    @Input()  rightContent;
  
    constructor( private cdRef:ChangeDetectorRef) { }
  
    ngOnInit() {
      this.cdRef.detectChanges();
    }
  </code></pre>