doubts firebase with ionic (ion-select)

0

I have an application, and I want to know how do I enter information into the firebase database and then put that data into an ion-select , my application uses a select of professions such as "mechanic", "bricklayer", "teacher", etc., and I want it to be within a ion-option of ion-select , but not I know how to do it. In my code I did so:

<ion-select [(ngModel)]="profissoes1" okText="Salvar" cancelText="Cancelar">
    <ion-option *ngFor="let items of items">{{items}}</ion-option>
  </ion-select>

and I want a tip on how to use typescript, to get the firebase professions to be in place of {{items}}, and how to enter the professions on the firebase as well

    
asked by anonymous 01.12.2017 / 05:33

1 answer

0

In this link there is a firebase tutorial, it will sure help you.

This other link refers to ion-select documentation.

The advantage of using FireBase is that you do not need to encode the back-end. However, before making the requisitions, you have to remember to change the default authorization to release those requisitions to other users. Once you have received the result of this request, you have to store it in a variable and iterate (repeat) with * NgFor and pass the value and name shown, for example:

<ion-select [(ngModel)]="data.person" multiple>
  <ion-option *ngFor="let name of namesList" [value] = "name.firstName" [checked]="false">{{name.firstName}}</ion-option>
</ion-select>

In this example it is understood that you have stored the result of the request in the namesList variable and for each item you call "name", and to access the attributes of this object, use the name object (name) followed by the name of the attribute (firstName), getting 'name.firstName'

    
01.12.2017 / 15:59