Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

244
Views
angular2-datatable No se pueden actualizar los datos

Una vez que se procesa la tabla de datos, no puedo actualizar los datos. Estoy usando angular2-datatable.

En mi appcomponent.html:

Si actualizo data2 en mi archivo appcomponent.ts de esta manera:

 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 } } }); })

Quiero vaciar la tabla de datos una vez que los marcadores estén enlazados.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Encontré una solución, aunque no estoy seguro de que esta sea la mejor manera.

He usado ChangeDetectorRef para detectar cambios.

 constructor(private http: Http,private httpservice: HttpService,private ref: ChangeDetectorRef) { ref.detach(); setInterval(() => { this.ref.detectChanges(); },1000); }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!