<ion-header>
  <ion-toolbar>
    <ion-title>动态发布</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-searchbar [(ngModel)]="searchKeyword" (ionInput)="searchDongTai()"></ion-searchbar>
  
  <ion-list>
    <ion-item *ngFor="let dongtai of dongtais">
      <ion-label>
        <h2>{{ dongtai.get('biaoti') }}</h2>
        <p>{{ dongtai.get('neirong') }}</p>
        <p>{{ dongtai.get('time') }}</p>
      </ion-label>
      <ion-button (click)="deleteDongTai(dongtai.id)">删除</ion-button>
    </ion-item>
  </ion-list>
  
  <ion-item>
    <ion-label>标题</ion-label>
    <ion-input [(ngModel)]="newBiaoti"></ion-input>
  </ion-item>
  <ion-item>
    <ion-label>内容</ion-label>
    <ion-input [(ngModel)]="newNeirong"></ion-input>
  </ion-item>
  <ion-item>
    <ion-label>时间</ion-label>
    <ion-input [(ngModel)]="newTime"></ion-input>
  </ion-item>
  <ion-item>
    <ion-label>上传图片</ion-label>
    <input type="file" (change)="onFileSelected($event)" />
  </ion-item>
  <ion-button expand="block" (click)="submitDongTai()">提交动态</ion-button>
</ion-content>
