No need for Angular, you can achieve this using pure Javascript:
// Generating the CSV file
const headers = ['header1', 'header2', ...];
let csvFile = 'data:text/csv;charset=utf-8,%EF%BB%BF';
csvFile += headers.join(';') + '\n';
for (const item of data) {
const row = [item.cell1, item.cell2].join(';');
csvFile += row + '\n';
}
// Initiating the download procedure
const encodedUri = csvFile;
const linkElement = document.createElement('a');
linkElement.setAttribute('target', '_blank');
linkElement.setAttribute('href', encodedUri);
linkElement.setAttribute('download', `your_filename.csv`);
document.body.appendChild(linkElement);
linkElement.click();
linkElement.remove();