Currently, I have an app developed using Ionic, TypeScript, AngularJS, and Phonegap. One of the functions in this app involves collecting information on whether the user is male or female. Initially, I created a static form for this purpose.
<ion-item>
<ion-label>Brand</ion-label>
<ion-select interface="popover">
<ion-option value="heineken">Heineken</ion-option>
<ion-option value="carlsberg">Carlsberg</ion-option>
</ion-select>
</ion-item>
The static form functioned correctly, allowing users to select either Female or Male. However, I wanted to enhance this functionality by making it dynamic and retrieving data from Firebase.
To achieve this, I made some changes in my HTML file:
<ion-item>
<ion-label stacked>Type of Trash</ion-label>
<ion-select [(ngModel)]="BrandsList (ionChange)="onSelectChange($event)">
<ion-option value="typeofbrand" *ngFor="let title of BrandsList"> {{title}}
</ion-option>
</ion-select>
</ion-item>
In addition, I added the following code in my .ts file:
BrandsList: FirebaseListObservable<any>;
...
this.BrandsList = db.list('/brands/');
Despite these changes, I am facing issues with getting the dynamic part to work. If anyone has any insights or suggestions on what might be going wrong, I would greatly appreciate your input.
For reference, you can view the image from my Firebase database here.
Thank you in advance for any assistance provided.