Skip to content

Instantly share code, notes, and snippets.

@aaronksaunders
Created May 10, 2016 13:43
Show Gist options
  • Save aaronksaunders/7f1aee236b34142039ea66483626f84a to your computer and use it in GitHub Desktop.
Save aaronksaunders/7f1aee236b34142039ea66483626f84a to your computer and use it in GitHub Desktop.
<ul *ngFor="let item of projects | async">
<li class="text">
{{item.name}}
</li>
<p>
{{(item.metadata | async)?.moreData}}
</p>
<p>
{{(item.metadata | async)?.stockPrice}}
</p>
</ul>
import { Component } from '@angular/core';
import { AngularFire } from 'angularfire2';
@Component({
moduleId: module.id,
selector: 'afwithngcli-app',
templateUrl: 'afwithngcli.component.html',
styleUrls: ['afwithngcli.component.css']
})
export class AfwithngcliAppComponent {
title = 'afwithngcli works!';
projects: any;
one: any;
constructor(af: AngularFire) {
this.projects = af.list('/items').map((items) => {
console.log(items);
return items.map(item => {
item.metadata = af.object('/items_meta/' + item.$key);
console.log(this.one);
return item;
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment