Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

211
Vistas
¿Cómo suscribir el observable?

enlace GitHub

Este es el archivo para la conexión del servidor, pero hay un problema con él. La parte Suscribirse ha quedado obsoleta. ¡Por favor, resuélvelo!

 import { Component } from '@angular/core'; import { map } from 'rxjs/operators'; import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout'; import { Observable } from 'rxjs'; import { AppService } from '../app.service'; @Component({ selector: 'app-dash', templateUrl: './dash.component.html', styleUrls: ['./dash.component.css'] }) export class DashComponent { /** Based on the screen size, switch from standard to one column per row */ cards=[]; cardsForHandset = []; cardsForWeb =[]; isHandset:boolean=false; isHandsetObserver:Observable<boolean> = this.breakpointObserver.observe(Breakpoints.Handset).pipe( map(({ matches }) => { if (matches) { return true; } return false; }) ); constructor(private breakpointObserver: BreakpointObserver, public appService:AppService) {} ngOnInit(){ this.isHandsetObserver.subscribe(currentObservervalue=> { this.isHandset = currentObservervalue; this.loadCards(); }); this.appService.getDeals().subscribe( //here the subscribe is decrepted response =>{ this.cardsForHandset = response.Handsetcards; this.cardsForWeb = response.Webcards; this.loadCards(); }, Error=>{ alert('their is a problem in the server.please try again later') } ) } loadCards(){ this.cards =this.isHandset ? this.cardsForHandset:this.cardsForWeb; } getImage(imageName:string):string{ return 'url('+'http://localhost:3000/images'+imageName+'jpg'+')'; } }

La declaración se marcó como obsoleta aquí:
Observable.d.ts(52, 9)
Este es el error en mi código.

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda