The given solution did not work completely. After some refreshes, it again started loading multiple times. I found the actual solution for it. Which is removing the below code from main.ts,
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/ngsw-worker.js').then(() => {
console.log('Service Worker Registered');
});
}
The service worker registration anyways happens in app.module.ts, so it is not required here which causes multiple reloads of the page on launch.