I want a loader to be running when an external JS is loaded in an angular project How can it be implemented? I have loaded the JS with the help of webPack.
JS is loaded on the click and it takes some time to get loaded. I want that the loader should be running until JS is not loaded completely to the DOM. I want to implement the loader at the common place.
{
path: 'pharmacy',
loadChildren: () => {
return loadScript('/deploy/pharmacy.js?timestamp=' + getDateTime(), 'dhsapp', 'AppModule');
},
data: { breadcrumb: 'Pharmacy', type: 'App' },
},