Alright?
I do not know what's missing to get the Firebase response using Angular2. I followed a tutorial that worked, but when trying on my project, I get 'null'. I do not know if I use FirebaseObjectObservable or FirebaseListObservable. Well, let's go to the code.
import { Component } from '@angular/core';
import { AngularFire, FirebaseObjectObservable } from 'angularfire2';
@Component({
selector: 'app-marcas',
templateUrl: './marcas.component.html'
})
export class MarcasComponent {
meufirebase: FirebaseObjectObservable<any[]>;
constructor(af: AngularFire) {
this.meufirebase = af.database.object('/marcas/marca_1/nome');
}
}
And my html:
<label>Escolha a marca</label>
<select materialize="material_select" [materializeSelectOptions]="marcas" class="browser-default">
<option *ngFor="let marca of marcas">{{ marcas.nome }}</option>
</select>
And an image of how I set up my Firebase
I'mwaitingforalittleguru'shand!Ahug!
Ihaveeditedapartofthecomponentcodeto:
constructor(af:AngularFire){constqueryObservable=af.database.list('/marcas',{query:{orderByChild:'nome'}});//subscribetochangesqueryObservable.subscribe(queriedItems=>{console.log(queriedItems);});}}
AndnowontheconsoleIhave:
In other words, I'm getting to Firebase, but something is still missing, since I do not understand those Object that should be tag_1, tag_2, tag_3 and tag_4 according to the structure of my bank ...