How to store data after query in the service?

Good day,

Are unable to fully understand the services. Request to find out from runs once (as it should). But going to another page, and after returning back, the data can not be correctly collected.
Bring them to the table "Data Tables" using *ngFor. When you first open the page there is a request to the backend and everything is well displayed and works. But if you re coming to the page data is visible, but if any action - disappear (for example, when you try to sort)

Component:
public dataTestServices: any;

 constructor(private servicesServices: ServicesService) {
}

 ngOnInit() {
this.servicesServices.getTestServices().subscribe(
 data => {
 this.dataTestServices = data.test_services;
});
 }


Service:
getTestServices() {
 return this.jsonApiService.getQuery('service/get_test');
 }
July 2nd 19 at 17:03
1 answer
July 2nd 19 at 17:05
Solution
There is a probability that you assign new (processed) array. Link to previous array is lost, the trash takes away all the data - that everything is lost. You need to work with the original or assign a new array to the component again.
Thank you. Actually the problem was in the plug-in DataTables. Not all options considered - Fay32 commented on July 2nd 19 at 17:08

Find more questions by tags TypeScriptAngular