0
I need to insert 30,000 records into the device (in Sqlite) through a file. But at the time of insertion, the application hangs. So I thought about creating an asynchronous service, but I don’t know how to do it using Angular 2.
Code:
this._http.get('assets/fishes.sql').subscribe(data => {
var queries = data.text().split(";");
for (var i = 0; i < queries.length; i++) {
var currentQuery = queries[i];
this.populaFishes(db, currentQuery);
}
});
How can I create a service that runs on background so that the application does not lock using Angular 2?
Do you plan to run this task more than once? Or just deploy? What exactly is the use case?
– Murillo Goulart