Skip to content

Instantly share code, notes, and snippets.

@heddendorp
Created August 9, 2016 17:08
Show Gist options
  • Select an option

  • Save heddendorp/68c99ccf0ab3b54402f89c2bdd6b8212 to your computer and use it in GitHub Desktop.

Select an option

Save heddendorp/68c99ccf0ab3b54402f89c2bdd6b8212 to your computer and use it in GitHub Desktop.
Ionic 2 problem files
<ion-header>
<ion-navbar news>
<button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Neuigkeiten</ion-title>
<ion-buttons end>
<button (click)="newPost()">
<ion-icon name="add"></ion-icon>
</button>
</ion-buttons>
</ion-navbar>
</ion-header>
<pan-newsfeed [news]="news | async" [users]="users | async" [self]="self | async" (scrollEnd)="doInfinite($event)"
(modifyPost)="modifyPost($event)" (newComment)="newComment($event)"></pan-newsfeed>
<!--============COMPONENT VIEW============-->
<ion-content padding class="feed" class="grey">
<div>
<ion-card *ngFor="let item of news">
<ion-item>
<ion-avatar item-left>
<img src="https://auszubildenden-netzwerk.de/assets/user_images/{{item.user_id}}.jpg">
</ion-avatar>
<h2>{{users[item.user_id].name}} {{test}}</h2>
<p>{{item.date | time}}</p>
</ion-item>
<div *ngFor="let file of item.files">
<a href="#" (click)="open('https://auszubildenden-netzwerk.de/files/'+file._id+'.'+file.type)"
style="margin-bottom: 5px;"><img *ngIf="['jpg','gif','png'].indexOf(file.type.toLowerCase())!=-1"
src="https://auszubildenden-netzwerk.de/files/thumbs/{{file._id}}.{{file.type}}"
style="margin-bottom: 5px;"></a>
</div>
<ion-card-content>
<p>{{item.text}}</p>
<ion-list>
<ion-list-item *ngFor="let file of item.files">
<a *ngIf="['jpg','gif','png', 'jpeg'].indexOf(file.type.toLowerCase())==-1" href="#"
(click)="open('https://auszubildenden-netzwerk.de/files/'+file._id+'.'+file.type)">{{file._id}}.{{file.type}}</a>
</ion-list-item>
</ion-list>
</ion-card-content>
<hr>
<ion-row class="post-data">
<div (click)="showPopover($event, item.likes)">Gefällt {{item.likes.length}}</div>
<div (click)="toggleComments(item)">{{item.comments.length}} {{item.comments.length == 1 ? 'Kommentar' :
'Kommentare' }}
</div>
<div (click)="showPopover($event, item.seen)">Gesehen von {{item.seen.length}}</div>
</ion-row>
<hr style="margin-bottom: -5px;">
<ion-row>
<ion-col>
<button grey clear small (click)="likePost(item)" *ngIf="item.likes.indexOf(self._id) == -1">
<ion-icon name="thumbs-up"></ion-icon>
<div>Gefällt mir</div>
</button>
<button primary clear small (click)="likePost(item)" *ngIf="item.likes.indexOf(self._id) != -1">
<ion-icon name="thumbs-up"></ion-icon>
<div>Gefällt mir</div>
</button>
</ion-col>
<ion-col width-100></ion-col>
<ion-col>
<button grey clear small (click)="addComment(item)">
<ion-icon name="text"></ion-icon>
<div>kommentieren</div>
</button>
</ion-col>
</ion-row>
<ion-list *ngIf="item.showComments">
<ion-item *ngFor="let comment of item.comments" text-wrap>
<ion-avatar item-left>
<img src="https://auszubildenden-netzwerk.de/assets/user_images/{{comment.user_id}}.jpg">
</ion-avatar>
<h2>{{users[comment.user_id].name}}
<small>{{comment.date | time}}</small>
</h2>
<p>{{comment.text}}</p>
</ion-item>
</ion-list>
</ion-card>
</div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content>
Lade mehr posts ...
</ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment