Currently, I am utilizing Angular version 5.2 for a room booking portal project. One of the requirements entails adding an event to the Outlook calendar on the day a room is booked. The system includes a table listing all bookings, with a button in each row to add the event to the Outlook calendar. Below is the code snippet I attempted:
var icsMSG = "BEGIN:VCALENDAR\nVERSION:2.0\nCALSCALE:GREGORIAN\nMETHOD:PUBLISH\nBEGIN:VEVENT\nUID:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9ba2a3a8a9dbf6fefeeff2f5fcebf7faf5f5fee9b5f2f4">[email protected]</a>\nDTSTART:" + bookingInfo.StartDate + "\nDTEND:" + bookingInfo.EndDate + "\nDTSTAMP:" + bookingInfo.StartDate + "\nLOCATION: " + bookingInfo.SpaceDescription + "\nSUMMARY: " + bookingInfo.EventDescription + "\nSEQUENCE:0\nTRANSP:OPAQUE\nEND:VEVENT\nEND:VCALENDAR";
window.open("data:text/calendar;charset=utf8," + escape(icsMSG));
This code utilized ical js but encountered issues in Internet Explorer and Chrome gave an exception during build time regarding 'escape' not being defined. Appreciate any assistance in resolving this matter!