This project was generated with Angular CLI version 8.3.29. and it support for angular 8 version
-
install library using below command.
Angular 8 => npm i common-http-loader@8.*
Angular 12 and above => npm i common-http-loader@1.*
-
Add package dependency for path in tsconfig.json
"compilerOptions":[
"paths": {
"@angular/*": ["./node_modules/@angular/*"],
"common-http-loader": ["./node_modules/common-http-loader"]
}
]
-
Add CommonHttpLoaderModule inside the appModule.ts
import { CommonHttpLoaderModule } from 'common-http-loader';
imports: [ CommonHttpLoaderModule ]
-
To show loader add below component selector to the app.component.html
<lib-common-http-loader></lib-common-http-loader>
Results :- after following all the above steps you will be able to monitor all the http calls and show and hide loader spinner
Suggestion and Feedback :- Email on pathademilind2@gmail.com