Property 'map' does not exist on type 'Object'. With Angular 5.0.3 - Ionic 3.19.1

0

I have an error that only happens when I execute the command "ionic serve", and in the browser it throws me the following message

Typescript Error Property 'map' does not exist on type 'Object'.

src / providers / contest / contest.ts

    return concursos.map((concurso) => new Concurso(concurso));
  })

I enclose the code as I have it:

import { HttpClient,HttpHeaders  } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Concurso} from '../../models/concurso';
import { Observable } from 'rxjs/Rx';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';


@Injectable()
export class ConcursoProvider {

  constructor(public http: HttpClient) {

	}

  public getAllConcursos(): Observable<Concurso[]>{
     return  this.http.get('/concursosj')
      .map(concursos => {
        
        return concursos.map((concurso) => new Concurso(concurso));
      })
      .catch((err)=>{
          console.log(err);
      });

  }
    
asked by Diegox Motta 20.02.2018 в 15:36
source

0 answers