打字稿问题this.ref.push()不起作用

我不知道这里是什么问题:

export class ProfilePage implements OnInit {
  data: Observable<any[]>;
  ref: AngularFireList<any>;


constructor(private afs: AngularFirestore,private user: UserService,public NavCtrl: NavController,private db: AngularFireDatabase,private toastCtrl: ToastController,public toastcontroller: ToastController) {
   }
async addTransaction() {
  this.ref.push(this.transaction).then(() => {
    this.transaction = {
      value: 0,expense: false,month: 0
    };
  });
}

这是控制台显示的内容:

  

ERROR错误:未捕获(承诺):TypeError:   无法读取未定义TypeError的属性“ push”:无法读取   未定义的属性“ push”

holly00 回答:打字稿问题this.ref.push()不起作用

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3165691.html

大家都在问