googlearchive / generator-angularfire

Yeoman generator for AngularFire: Angular + Firebase apps
191 stars 52 forks source link

CRUD operation cannot properly working! #74

Closed asifaathwal closed 6 years ago

asifaathwal commented 6 years ago

hy! i am creating an app in ionic with firebase...i have seen many taturials for CRUD and follow this method .....the problem is it only accept one value or argumant....plz tell me how can i add more fields in firebase database.

Add.html

Name catagory

<button (click)="btnAddClicked()" ion-button>Add

Add.ts

export class AddcatagoryPage {

arrData = []
  catagory
  fname

constructor(public navCtrl: NavController, public navParams: NavParams, private fdb: AngularFireDatabase) {

//this.fdb.list("/myItems/").subscribe(_data => {
    fdb.list('items').valueChanges().subscribe(_data => {
        this.arrData = _data;

   console.log(this.arrData);
 });

//  this.arrData = _data;

//   console.log(this.arrData);
// });

}

btnAddClicked(){ this.fdb.list("/myItems/").push(this.catagory); }

firebase

capture3