Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ion-content>
- <ion-list *ngFor="let i of informations | async" >
- <ion-item (click)="OpenDetails(i.key)">{{i.title}}</ion-item>
- </ion-list>
- </ion-content>
- import { Component } from '@angular/core';
- import { NavController, NavParams } from 'ionic-angular';
- import { AngularFireDatabase } from 'angularfire2/database';
- import { InformationdetailsPage } from '../informationdetails/informationdetails';
- import { map } from 'rxjs/operators';
- @Component({
- selector: 'page-list',
- templateUrl: 'list.html'
- })
- export class ListPage {
- informationslist:any;
- informations:any;
- constructor(public navCtrl: NavController, public navParams: NavParams,
- private afDB: AngularFireDatabase) {
- this.informationslist = afDB.list('information');
- this.informations = this.informationslist.snapshotChanges().pipe(
- map(changes =>
- changes.map(c => ({ key: c.payload.key, ...c.payload.val() }))
- )
- );
- }
- OpenDetails(key:any){
- this.navCtrl.push(InformationdetailsPage, key);
- }
- }
- this.informations = this.informationslist.snapshotChanges().pipe(
- **map**(changes =>
- changes.map(c => ({ key: c.payload.key, ...c.payload.val() }))
- )
- );
- import { map } from 'rxjs/operators';
- this.informations = this.informationslist.snapshotChanges().pipe(
- map(changes =>
- changes.**map**(c => ({ key: c.payload.key, ...c.payload.val() }))
- )
- );
Add Comment
Please, Sign In to add comment