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

233
Vistas
angular2-datatable Not able to update data

After the datatable once get rendered , I am not able to update data. I am using angular2-datatable.

In my appcomponent.html:

If I update data2 in my appcomponent.ts file like this:

this.httpservice.getdata().subscribe
(data=>
{   this.data2=data;
    for (i = 0; i < 21; i++) {
    markerarray[i] = new google.maps.Marker({
    position: new google.maps.LatLng(this.data2[i].latituide, this.data2
    [i].longituide),          //In this line
    title: this.data2[i].name,  //and this
    map: map
    });
        }
    google.maps.event.addListener(map, 'idle', function () {

            var bounds = map.getBounds();
           for (var i = 0; i < 20; i++) {
            var marker = markerarray[i];
           if (bounds.contains(marker.getPosition()) === true) {
            this.data2.length=0;// This is not working for me
            }
            }

        });
 })

I want to empty the datatable once the markers are in bound.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I figured out a solution , though I am not sure that this is the best way.

I have used ChangeDetectorRef for detecting changes.

  constructor(private http: Http,private httpservice: HttpService,private ref: ChangeDetectorRef) {
       ref.detach();
    setInterval(() => {
      this.ref.detectChanges();
    },1000);
    }
over 4 years ago · Santiago Trujillo Denunciar
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