'Type 'Observable<ArrayBuffer>' is not assignable to type 'Observable<Date[]>'

  consultar ( opcion: string, articulo: Articulo ): Observable<Date[]> {
    return this.http.get<Date[]>( this.rootUrl + "consultar?opcion=" + opcion, articulo );
  }

PROBLEM: Type 'Observable' is not assignable to type 'Observable<Date[]>'. Type 'ArrayBuffer' is missing the following properties from type 'Date[]': length, pop, push, concat, and 27 more.



Solution 1:[1]

The second parameter in get should be options, but you are probably passing it data.

Angular docs - get method

Constructs a GET request that interprets the body as an ArrayBuffer and returns the response in an ArrayBuffer.

Get Method Parameters

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Piotr Sternik