here i want to know how can i create a text file or json file and download it with dynamic data which is going to be filled with.
below is my
service code
validateUserData(userId) {
var headers = new Headers();
return this.http.get(`${this.baseUrl}/Users?userId=`+userId,{headers: headers}).map(result => {
return result.json();
});
}
component.ts
this.service.validateUserData(userId).subscribe( res => {
console.log(res);
new Angular2Txt(res, 'My Report');
});
here i want to send the Response to a textFile or json file which i have to create it so that user can able to download how can i do it
Angular package
i tried the above package but i able to download only empty file
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…