Skip to content

Commit 002528e

Browse files
authored
Merge pull request #39 from mpalourdio/0.7.0
Fixes #31 : Add possibility to define a custom spinner
2 parents c31279a + 4a75251 commit 002528e

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

CHANGELOG.MD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v0.7.0
4+
5+
This release adds the ``entryComponent`` property. It allows to specify your own component instead of the built-in ones. It uses the [NgComponentOutlet](https://angular.io/api/common/NgComponentOutlet) feature.
6+
7+
See [Defining your own spinner](https://github.com/mpalourdio/ng-http-loader#defining-your-own-spinner) section.
8+
39
## v0.6.0
410

511
This release adds the ``debounceDelay`` parameter (default is 0). It allows to discard the spinner for fast and repeated http requests, which can be annoying under some conditions.

README.MD

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Contributing
1212

13-
Use the fork, Luke (And add tests).
13+
Use the fork, Luke. PR without tests will likely not be merged.
1414

1515
## Installation
1616

@@ -136,6 +136,18 @@ The different spinners available are referenced in [this class](src/spinkits.ts)
136136
<spinner backgroundColor="#ff0000" spinner="sk-wave"></spinner>
137137
```
138138

139+
## Defining your own spinner
140+
141+
You can define your own loader component in place of the built-in ones. The needed steps are:
142+
143+
- Create your component
144+
- Add it to the [entryComponent](https://angular.io/guide/ngmodule-faq#what-is-an-entry-component) definition in your module definition
145+
- Reference your component in a public property in your ``app.component.ts``
146+
- Reference the property in the spinner component like this :
147+
```xml
148+
<spinner [entryComponent]="myAwesomeComponent"></spinner>
149+
```
150+
139151
## Requests filtering
140152

141153
You can also filter the http requests that shouldn't be caught by the interceptor by providing **an array of regex patterns**:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-http-loader",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"scripts": {
55
"prepare-deploy": "gulp inline-templates && gulp clean-dist && ngc -p tsconfig.ngc.json && gulp clean-tmp && gulp copy-all",
66
"test": "ng test --watch false"

src/components/spinner/spinner.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class SpinnerComponent implements OnDestroy, OnInit {
3434
@Input()
3535
public debounceDelay = 0;
3636
@Input()
37-
public entryComponent = null;
37+
public entryComponent: any = null;
3838

3939
constructor(private pendingRequestInterceptorService: PendingInterceptorService) {
4040
this.subscription = this.pendingRequestInterceptorService

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3680,8 +3680,8 @@ jasmine-core@~2.6.2:
36803680
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.6.4.tgz#dec926cd0a9fa287fb6db5c755fa487e74cecac5"
36813681

36823682
jasmine-core@~2.9.0:
3683-
version "2.9.0"
3684-
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.9.0.tgz#bfbb56defcd30789adec5a3fbba8504233289c72"
3683+
version "2.9.1"
3684+
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.9.1.tgz#b6bbc1d8e65250d56f5888461705ebeeeb88f22f"
36853685

36863686
jasmine-spec-reporter@~4.1.0:
36873687
version "4.1.1"
@@ -7005,8 +7005,8 @@ uglify-es@^3.3.4:
70057005
source-map "~0.6.1"
70067006

70077007
uglify-js@3.3.x:
7008-
version "3.3.7"
7009-
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.7.tgz#28463e7c7451f89061d2b235e30925bf5625e14d"
7008+
version "3.3.8"
7009+
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.8.tgz#51e9a5db73afb53ac98603d08224edcd0be45fd8"
70107010
dependencies:
70117011
commander "~2.13.0"
70127012
source-map "~0.6.1"
@@ -7331,8 +7331,8 @@ webpack-dev-middleware@1.12.2, webpack-dev-middleware@~1.12.0:
73317331
time-stamp "^2.0.0"
73327332

73337333
webpack-dev-server@~2.11.0:
7334-
version "2.11.0"
7335-
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.11.0.tgz#e9d4830ab7eb16c6f92ed68b92f6089027960e1b"
7334+
version "2.11.1"
7335+
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.11.1.tgz#6f9358a002db8403f016e336816f4485384e5ec0"
73367336
dependencies:
73377337
ansi-html "0.0.7"
73387338
array-includes "^3.0.3"
@@ -7357,7 +7357,7 @@ webpack-dev-server@~2.11.0:
73577357
sockjs "0.3.19"
73587358
sockjs-client "1.1.4"
73597359
spdy "^3.4.1"
7360-
strip-ansi "^4.0.0"
7360+
strip-ansi "^3.0.0"
73617361
supports-color "^5.1.0"
73627362
webpack-dev-middleware "1.12.2"
73637363
yargs "6.6.0"

0 commit comments

Comments
 (0)