1
resposta

code: 2305, severity: 8, message: O módulo Alura-Cursos/FrontEnd/alurapic/node_modules/rxjs/operator\ não tem nenhum membro exportado debounceTime

import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subject } from 'rxjs';
import { debounceTime } from 'rxjs/operator';

import { Photo } from './../photo/photo';


@Component({
  selector: 'app-photo-list',
  templateUrl: './photo-list.component.html',
  styleUrls: ['./photo-list.component.css']
})
export class PhotoListComponent implements OnInit, OnDestroy {

  filter = '';
  photos: Photo[] = [];
  debounce: Subject<string> = new Subject<string>();

  constructor(private activatedRoute: ActivatedRoute) { }

  ngOnInit(): void {
    this.photos = this.activatedRoute.snapshot.data['photos'];
    this.debounce
        .pipe(debounceTime(300))
        .subscribe(filter => this.filter = filter);
  }

  ngOnDestroy(): void {
    this.debounce.unsubscribe();
  }
}
1 resposta

Oi, Ricardo, tudo bem?

Verifica se a falta do sem from 'rxjs/operators'; na palavra operators é o erro que nos retorna com o debounceTime.