Skip to content

Instantly share code, notes, and snippets.

@crissjm
Created January 4, 2018 01:36
Show Gist options
  • Save crissjm/879ee48ed5123f0b9d97536fff048b2f to your computer and use it in GitHub Desktop.
Save crissjm/879ee48ed5123f0b9d97536fff048b2f to your computer and use it in GitHub Desktop.
home.html
<ion-header>
<ion-navbar>
<ion-title>Home</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<button ion-button full (click)="newPost()">
<ion-icon name="create"></ion-icon>
&nbsp; New Post
</button>
<div *ngIf="posts">
<ion-card *ngFor="let post of posts">
<ion-item>
<br/>
<h3>{{ post.id }} - {{ post.title }}</h3>
</ion-item>
<ion-card-content>
<p>{{ post.body }}</p>
</ion-card-content>
<ion-row>
<ion-col>
<button [disabled]="uid != post.uid" color="secondary" ion-button icon-left clear small (click)="editPost(post.id)">
<ion-icon name="sync"></ion-icon>
<div>Update</div>
</button>
</ion-col>
<ion-col>
<button [disabled]="uid != post.uid" color="danger" ion-button icon-left clear small (click)="removePost(post.id)">
<ion-icon name="trash"></ion-icon>
<div>Remove</div>
</button>
</ion-col>
</ion-row>
</ion-card>
</div>
</ion-content>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment