Created
May 10, 2016 13:43
-
-
Save aaronksaunders/7f1aee236b34142039ea66483626f84a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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