When I pass the data from node server to front-end (angular 9), I faced the problem. I made the server side using node and called data from google sheet api. I tried to get the data from node server to angular and searched on google, but I couldn't find the result.
Here is my code of node server for calling data from googlesheet.
const doc = new GoogleSpreadsheet('1w0aEvmo8H-PPMQEaYWEfN8QSoeGgAKIb9gA0fr4V9VM');
async function accessSpreadSheet() {
await doc.useServiceAccountAuth({
client_email: creds.client_email,
private_key: creds.private_key,
});
await doc.loadInfo(); // loads document properties and worksheets
const sheet = doc.sheetsByIndex[0]; // or use doc.sheetsById[id]
console.log(sheet.title);
console.log(sheet.rowCount);
}
accessSpreadSheet();
In this case, I am not sure how can I pass data of server to angular front-end?
I followed to lots of stackoverflows, but couldn't get them.
Bellow links were I followed.
How do I pass node.js server variables into my angular/html view?
How to send JSON data from node to angular 4
send data from node.js to angular with get()
Please let me know how can I get the data from server into my frontend?
Thanks