Search code examples
angularabp-framework

subscribe(next: null | undefined, error: (error: any) => void, complete?: () => void): Subscription;


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. authorService

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

This error Message popping up when mouse over on subscribe: error Message popping up when mouse over on subscribe


Solution

  • 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
      }
    })