Skip to content

Commit

Permalink
chore: Update README for standalone components. Fixes #188
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalourdio committed Dec 11, 2023
1 parent ad07897 commit 225d0d7
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,38 @@ In your app.component.html, simply add:
```xml
<ng-http-loader></ng-http-loader>
```
## Standalone components

If you prefer using standalone components, you should configure your `ApplicationConfig` like following

```typescript
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(routes),
provideHttpClient(
withInterceptorsFromDi() // <== Don't forget to import the interceptors
),
importProvidersFrom(NgHttpLoaderModule.forRoot()) //<== Always call `forRoot`
],
};
```
Then you can use `ng-http-loader` like this
```typescript
import { Component } from '@angular/core';
import {NgHttpLoaderModule} from "ng-http-loader";

@Component({
selector: 'my-selector',
standalone: true,
imports: [
NgHttpLoaderModule
],
template: `
<ng-http-loader />`,
})
export class InlineComponent {
}
```
## Customizing the spinner

You can customize the following parameters:
Expand Down

0 comments on commit 225d0d7

Please sign in to comment.