ng-ytl-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
51 lines (47 loc) • 1.57 kB
text/typescript
import {
AfterContentInit,
Component,
ContentChild,
ContentChildren,
OnInit,
QueryList,
TemplateRef,
ViewEncapsulation,
} from '@angular/core';
import { NzTimelineItemComponent } from './nz-timeline-item.component';
export class NzTimelineComponent implements OnInit, AfterContentInit {
_isPending = false;
items: NzTimelineItemComponent[] = [];
_listOfTimeline: QueryList<NzTimelineItemComponent>;
_pendingContent: TemplateRef<void>;
ngOnInit(): void {
if (this._pendingContent) {
this._isPending = true;
}
}
ngAfterContentInit(): void {
setTimeout(_ => {
if (this._listOfTimeline && this._listOfTimeline.length) {
const listArray = this._listOfTimeline.toArray();
listArray[ listArray.length - 1 ]._lastItem = true;
}
});
}
}