This is my .ts file and i don't know why i am getting the error above. The push on the addClick method has a red dotted line beneath it.
I followed a tutorial and it is the same as the guy did it on his tutorial.
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from
'ionic-angular';
import { AngularFireDatabase , AngularFireObject }
from 'angularfire2/database';
import { Observable } from 'rxjs';
@IonicPage()
@Component({
selector: 'page-create-quiz',
templateUrl: 'create-quiz.html',
})
export class CreateQuizPage {
tasks : Observable <any> ;
myInput;
constructor(public db:AngularFireDatabase){
this.tasks = this.db.object('/tasks').valueChanges()
this.tasks .subscribe(data => {
this.myInput = data;
})
}
addclick(){
this.db.object<any>('/tasks').push(this.myInput);
}
ionViewDidLoad() {
console.log('ionViewDidLoad CreateQuizPage');
}
}
This is my.html file
<ion-header>
<ion-navbar>
<ion-title>Create you quiz here</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-item>
<ion-input [(ngModel)] = "myInput" ></ion-input>
</ion-item>
<button (click)= "addclick()"> Add</button>
</ion-content>