IONIC的新成員。IONIC滾動到div
所以我顯示一個日期的負載,但是當頁面顯示時我想滾動到TODAY。
現在確定我該怎麼做? 模型上有一個標誌,告訴它是否是今天,如果有幫助? (即day.IsToday)
<ion-item-group *ngFor="let day of allAppDays; let i = index;" >
<ion-item-divider color="light"> {{day.Date | date : ' EEE d MMM yyyy' }}</ion-item-divider>
<button class="appbutton" ion-item *ngFor="let a of day.Appointments" (click)="goToApp(a)">
<ion-grid>
<ion-row>
<ion-col col-3 [class]="getAppClass(a)">
<p style="padding-top:6px;">{{a.Start|date:'h:mm a'}} <br />{{a.End|date:'h:mm a'}}</p>
<div class="vertline"></div>
</ion-col>
<ion-col>
<p class="font-sub pl10">{{a.ClientFirstName}} {{a.ClientLastName}}</p>
</ion-col>
</ion-row>
</ion-grid>
</button>
</ion-item-group>
//打字稿
ngOnInit() {
this.getData();
}
//Lets go and get data from the API
getData() {
this.getApps(false,() => {
this.loader.dismiss();
});
}
getApps(cacheOnly = false, complete: any = null) {
this.apiService.getschedule(cacheOnly).subscribe((a: AppointmentDay[]) => {
this.allAppDays = a;
if (complete != null) { complete(); }
}, (err: any) => {
if (complete != null) { complete(); }
});
}
預先感謝您。