Skip to content

Commit 734623c

Browse files
committed
chore(doc): Improve documentation regarding entryComponents
1 parent 515fa4f commit 734623c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,23 @@ The different spinners available are referenced in [this file](src/lib/spinkits.
138138
You can define your own spinner component in place of the built-in ones. The needed steps are:
139139

140140
- Create your component
141-
- Add it to the [entryComponents](https://angular.io/guide/ngmodule-faq#what-is-an-entry-component) array in your module's configuration (not necessary anymore with [ivy](https://next.angular.io/guide/deprecations#entryComponents))
142141
- Reference your component as a public property in your `app.component.ts`
143-
- Reference the predefined property in the ng-http-loader component selector like this:
142+
- Reference the predefined property in the ng-http-loader `entryComponent` component selector like this:
143+
```typescript
144+
import { Component } from '@angular/core';
145+
import { AwesomeComponent } from 'my.awesome.component';
146+
147+
@Component({
148+
selector: 'app-root',
149+
templateUrl: './app.component.html',
150+
styleUrls: ['./app.component.css']
151+
})
152+
export class AppComponent {
153+
public awesomeComponent = AwesomeComponent;
154+
}
155+
```
144156
```xml
145-
<ng-http-loader [entryComponent]="myAwesomeComponent"></ng-http-loader>
157+
<ng-http-loader [entryComponent]="awesomeComponent"></ng-http-loader>
146158
```
147159

148160
You can find some examples [here](https://gist.github.com/mpalourdio/2c0bec03d610b24ff49db649fbb69a48) and [here](https://gist.github.com/mpalourdio/e05b4495de2abeeecfcf92d70e4ef93e).

0 commit comments

Comments
 (0)