Home > OS >  subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Subscri
subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Subscri

Time:06-02

I was following the tutorial but I get this error. https://docs.abp.io/en/abp/latest/Tutorials/Part-3?UI=NG&DB=EF

subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Subscription; An argument for 'error' was not provided.

Actually, I couldn't find where did I make mistake. Can anyone help me about this one? authorService

This Error Message Popping when mouse over on subscribe

CodePudding user response:

try it like this:

 request.subscribe(
    () => {
      this.isModalOpen = false;
      this.form.reset();
      this.list.get();
    },
    err => console.error(err)
);

maybe you are using another version of RxJS and you need to handle errors or you have another configuration on Typescript

CodePudding user response:

request.subscribe({
  next: (response) => {
    // treat recieved data
  },
  error: (error) => {
    // treat error
  },
  complete: () => {
    // define on request complete logic
    // 'complete' is not the same as 'finalize'!!
    // this logic will not be executed if error is fired
  }
})
  • Related