title: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked
body: <p>I have a problem with this one.</p>
  <p>I have a create a timeline to display schedule when vessels are supposed to dock on different terminals. it looks like that:</p>
  <pre><code>&lt;ul class=&quot;vessels-schedule&quot;&gt;
    &lt;li *ngFor=&quot;let terminal of terminals&quot; class=&quot;mt-3&quot;&gt;
      &lt;div class=&quot;terminal-schedule&quot; #terminalSchedule #test&gt;
        &lt;div class=&quot;terminal-information&quot; #terminalInformation&gt;
          &lt;h3 class=&quot;terminal-name&quot;&gt;{{terminal.name}}&lt;/h3&gt;          
        &lt;/div&gt;
        &lt;div *ngFor=&quot;let date of dates&quot; class=&quot;vessel-date&quot; #vesselDate&gt;&lt;/div&gt;
        &lt;div class=&quot;vessels&quot;&gt;
          &lt;div *ngFor=&quot;let vessel of terminal.vessels; let index = index&quot;
              class=&quot;vessel&quot; 
              [style.left.px]=&quot;getVesselPosition(vessel.estimateTimeArrival)&quot;
              tabindex=&quot;0&quot; #vessel&gt;
          ...
  </code></pre>
  <p>It renders a row by terminal + a grid for each day <code>*ngFor=&quot;let date of dates&quot;</code> and all vessels for this terminal positioned at the right date/time.</p>
  <p>I have also a couples of <code>ViewChild</code> to dynamically calculate position:</p>
  <pre><code>@ViewChildren('terminalSchedule') terminalSchedule: QueryList&lt;ElementRef&gt;;
  @ViewChild('terminalInformation') terminalInformation: ElementRef;
  @ViewChild('vesselDate') vesselDate: ElementRef;
  @ViewChild('vessel') vessel: ElementRef;
  
  ...
  
  ngAfterViewInit(): void {
    this.terminalSchedule.changes.subscribe(item =&gt; {
      if (this.terminalSchedule.length) {
        this.terminalScheduleOffsetWidth = this.terminalSchedule.first.nativeElement.offsetWidth;
        this.terminalInformationOffsetWidth = this.terminalInformation.nativeElement.offsetWidth;
        this.vesselDateOffsetWidth = this.vesselDate.nativeElement.offsetWidth;
        this.vesselOffsetWidth = this.vessel !== undefined ? this.vessel.nativeElement.offsetWidth : 0;
        ...
  </code></pre>
  <p>And a function to set the position that returns a pixel value.</p>
  <p>I don't know if it's because I don't initialize it at the right place, but when I bind data I have this in the console (it works though!):</p>
  <pre><code>NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value for 'left': '0'. Current value: '301.5416666666667'.
  </code></pre>
  <p>I initialize the terminal list right in OnChanges():</p>
  <pre><code>ngOnChanges(): void {
    ...
    this.getTerminal();
  }
  </code></pre>
  <p>Also, in the complementary question, I try to figure the best approach for resizing. Right now, I change a boolean property on resize to force re-render, I don't know if it's a good idea...</p>