File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,38 @@ In your app.component.html, simply add:
8787``` xml
8888<ng-http-loader ></ng-http-loader >
8989```
90+ ## Standalone components
9091
92+ If you prefer using standalone components, you should configure your ` ApplicationConfig ` like following
93+
94+ ``` typescript
95+ export const appConfig: ApplicationConfig = {
96+ providers: [
97+ provideRouter (routes ),
98+ provideHttpClient (
99+ withInterceptorsFromDi () // <== Don't forget to import the interceptors
100+ ),
101+ importProvidersFrom (NgHttpLoaderModule .forRoot ()) // <== Always call `forRoot`
102+ ],
103+ };
104+ ```
105+ Then you can use ` ng-http-loader ` like this
106+ ``` typescript
107+ import { Component } from ' @angular/core' ;
108+ import {NgHttpLoaderModule } from " ng-http-loader" ;
109+
110+ @Component ({
111+ selector: ' my-selector' ,
112+ standalone: true ,
113+ imports: [
114+ NgHttpLoaderModule
115+ ],
116+ template: `
117+ <ng-http-loader /> ` ,
118+ })
119+ export class InlineComponent {
120+ }
121+ ```
91122## Customizing the spinner
92123
93124You can customize the following parameters:
You can’t perform that action at this time.
0 commit comments