Skip to content

Commit

Permalink
fix(timeline): eliminate ExpressionChangedAfterItHasBeenCheckedError …
Browse files Browse the repository at this point in the history
…when use ngFor to render
  • Loading branch information
SangKa committed Aug 17, 2017
1 parent 0c6bcbb commit 67df061
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/timeline/nz-timeline.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ export class NzTimelineComponent implements OnInit, AfterContentInit {
}

ngAfterContentInit() {
if (this._listOfTimeline && this._listOfTimeline.length) {
const listArray = this._listOfTimeline.toArray();
listArray[ listArray.length - 1 ]._lastItem = true;
}
setTimeout(_ => {
if (this._listOfTimeline && this._listOfTimeline.length) {
const listArray = this._listOfTimeline.toArray();
listArray[ listArray.length - 1 ]._lastItem = true;
}
});
}
}

0 comments on commit 67df061

Please sign in to comment.