Skip to content

Commit 91d93c2

Browse files
authored
Merge pull request #65 from mpalourdio/ng6
Angular 6 / RxJS 6 support. Fixes #62 #63
2 parents 2201505 + 42f739a commit 91d93c2

32 files changed

+825
-816
lines changed

.angular-cli.json

-43
This file was deleted.

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ insert_final_newline = true
99
trim_trailing_whitespace = true
1010
end_of_line = lf
1111

12-
[{package.json,.angular-cli.json,tslint.json,karma.conf.js,tsconfig*.json}]
12+
[{package.json,angular.json,tslint.json,karma.conf.js,tsconfig*.json,test.ts,main.ts,polyfills.ts}]
1313
indent_style = space
1414
indent_size = 2
1515

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ src
55
tmp
66
dist
77
coverage
8-
.angular-cli.json
8+
angular.json
99
.editorconfig
1010
.gitignore
1111
.npmignore

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
sudo: required
22
language: node_js
33
node_js:
4-
- 6.14.1
54
- lts/*
65
- node

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.0.0
4+
5+
This release introduces full support for angular 6 & RxJS 6.
6+
37
## v0.9.1
48

59
This release fixes a bug on the SpinKit Sk-Wave component that only appeared after template inlining.

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ $ npm install ng-http-loader --save
2525
This package provides an HTTP Interceptor, and a spinner component (All from [SpinKit](https://github.com/tobiasahlin/SpinKit) at the moment).
2626
The HTTP interceptor listens to all HTTP requests and shows a spinner / loader indicator during pending http requests.
2727

28-
## Angular 4 / Angular 5
28+
## Angular 4 / Angular 5 / Angular 6
2929

30-
The latest module version compatible with angular 4 is **``0.3.4``**.
30+
The latest compatible version with angular 4 is **``0.3.4``**.
3131
If you want to use Angular 5, use versions **``0.4.0``** and above.
3232

33+
The latest compatible version with angular 5 is version **``0.9.1``**.
34+
35+
Versions above **``0.9.1``** are angular 6 / RxJS 6 compatible only.
36+
3337
If you experience errors like below, **please double check the version you use.**
3438

3539
``ERROR in Error: Metadata version mismatch for module [...]/angular/node_modules/ng-http-loader/ng-http-loader

angular.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ng-http-loader": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "library",
10+
"architect": {
11+
"test": {
12+
"builder": "@angular-devkit/build-angular:karma",
13+
"options": {
14+
"main": "./test.ts",
15+
"karmaConfig": "./karma.conf.js",
16+
"polyfills": "./polyfills.ts",
17+
"tsConfig": "./tsconfig.spec.json",
18+
"watch": false
19+
}
20+
}
21+
}
22+
}
23+
},
24+
"defaultProject": "ng-http-loader",
25+
"schematics": {
26+
"@schematics/angular:component": {
27+
"prefix": null,
28+
"styleext": "css"
29+
},
30+
"@schematics/angular:directive": {
31+
"prefix": null
32+
}
33+
}
34+
}

karma.conf.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44
module.exports = function (config) {
55
config.set({
66
basePath: 'test',
7-
frameworks: ['jasmine', '@angular/cli'],
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
88
plugins: [
99
require('karma-jasmine'),
1010
require('karma-phantomjs-launcher'),
1111
require('karma-chrome-launcher'),
1212
require('karma-jasmine-html-reporter'),
1313
require('karma-coverage-istanbul-reporter'),
14-
require('@angular/cli/plugins/karma')
14+
require('@angular-devkit/build-angular/plugins/karma')
1515
],
1616
client: {
1717
clearContext: false // leave Jasmine Spec Runner output visible in browser
1818
},
1919
coverageIstanbulReporter: {
20+
dir: require('path').join(__dirname, 'coverage'),
2021
reports: ['html', 'lcovonly'],
2122
fixWebpackSourcePaths: true
2223
},

package.json

+31-26
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "ng-http-loader",
3-
"version": "0.9.1",
3+
"version": "1.0.0",
44
"scripts": {
55
"prepare-deploy": "gulp inline-templates && gulp clean-dist && ngc -p tsconfig.ngc.json && gulp clean-tmp && gulp copy-all",
6-
"test": "ng test --watch false"
6+
"test": "ng test"
77
},
88
"repository": {
99
"type": "git",
@@ -29,41 +29,46 @@
2929
"url": "https://github.com/mpalourdio/ng-http-loader/issues"
3030
},
3131
"peerDependencies": {
32-
"@angular/common": "^5.2.0",
33-
"@angular/core": "^5.2.0",
34-
"rxjs": "^5.5.6"
32+
"@angular/common": "^6.0.0",
33+
"@angular/core": "^6.0.0",
34+
"rxjs": "^6.0.0"
3535
},
3636
"devDependencies": {
37-
"@angular/cli": "^1.7.0",
38-
"@angular/common": "^5.2.0",
39-
"@angular/compiler": "^5.2.0",
40-
"@angular/compiler-cli": "^5.2.0",
41-
"@angular/core": "^5.2.0",
42-
"@angular/language-service": "^5.2.0",
43-
"@angular/platform-browser": "^5.2.0",
44-
"@angular/platform-browser-dynamic": "^5.2.0",
45-
"@types/jasmine": "~2.8.3",
46-
"@types/jasminewd2": "~2.0.2",
47-
"@types/node": "~6.0.60",
48-
"codelyzer": "^4.0.1",
49-
"core-js": "^2.4.1",
37+
"@angular-devkit/build-angular": "~0.6.0",
38+
"@angular/cli": "^6.0.0",
39+
"@angular/common": "^6.0.0",
40+
"@angular/compiler": "^6.0.0",
41+
"@angular/compiler-cli": "^6.0.0",
42+
"@angular/core": "^6.0.0",
43+
"@angular/language-service": "^6.0.0",
44+
"@angular/platform-browser": "^6.0.0",
45+
"@angular/platform-browser-dynamic": "^6.0.0",
46+
"@types/jasmine": "~2.8.6",
47+
"@types/jasminewd2": "~2.0.3",
48+
"@types/node": "~8.9.4",
49+
"codelyzer": "~4.2.1",
50+
"core-js": "^2.5.4",
5051
"gulp": "^3.9.1",
5152
"gulp-clean": "^0.3.2",
5253
"gulp-inline-ng2-template": "^4.0.0",
53-
"jasmine-core": "~2.8.0",
54+
"jasmine-core": "~2.99.1",
5455
"jasmine-spec-reporter": "~4.2.1",
5556
"karma": "~2.0.0",
5657
"karma-chrome-launcher": "~2.2.0",
57-
"karma-coverage-istanbul-reporter": "^1.2.1",
58-
"karma-jasmine": "~1.1.0",
58+
"karma-coverage-istanbul-reporter": "~1.4.2",
59+
"karma-jasmine": "~1.1.1",
5960
"karma-jasmine-html-reporter": "^0.2.2",
6061
"karma-phantomjs-launcher": "^1.0.4",
6162
"phantomjs-prebuilt": "^2.1.14",
62-
"protractor": "~5.1.2",
63-
"rxjs": "^5.5.6",
64-
"ts-node": "~4.1.0",
63+
"protractor": "~5.3.0",
64+
"rxjs": "^6.0.0",
65+
"ts-node": "~5.0.1",
6566
"tslint": "~5.9.1",
66-
"typescript": "~2.5.3",
67-
"zone.js": "^0.8.19"
67+
"typescript": "2.7.2",
68+
"zone.js": "^0.8.26"
69+
},
70+
"engines": {
71+
"node": ">= 8.9.0",
72+
"npm": ">= 5.5.1"
6873
}
6974
}

src/components/ng-http-loader-components.module.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88
*/
99

10-
import { NgModule } from '@angular/core';
1110
import { CommonModule } from '@angular/common';
1211
import { HttpClientModule } from '@angular/common/http';
13-
import { SpinnerComponent } from './spinner/spinner.component';
12+
import { NgModule } from '@angular/core';
1413
import { SPINKIT_COMPONENTS } from '../spinkits';
14+
import { SpinnerComponent } from './spinner/spinner.component';
1515

1616
@NgModule({
1717
declarations: [

src/components/spinner/spinner.component.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@
88
*/
99

1010
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
11-
import { Subscription } from 'rxjs/Subscription';
12-
import { Spinkit } from '../../spinkits';
11+
import { merge, Observable, Subscription, timer } from 'rxjs';
12+
import { debounce } from 'rxjs/operators';
1313
import { PendingInterceptorService } from '../../services/pending-interceptor.service';
1414
import { SpinnerVisibilityService } from '../../services/spinner-visibility.service';
15-
import { timer } from 'rxjs/observable/timer';
16-
import { Observable } from 'rxjs/Observable';
17-
import { merge } from 'rxjs/observable/merge';
18-
import { debounce } from 'rxjs/operators';
15+
import { Spinkit } from '../../spinkits';
1916

2017
@Component({
2118
selector: 'spinner',

src/ng-http-loader.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88
*/
99

10-
import { NgModule } from '@angular/core';
1110
import { CommonModule } from '@angular/common';
11+
import { NgModule } from '@angular/core';
1212
import { NgHttpLoaderComponentsModule } from './components/ng-http-loader-components.module';
1313
import { NgHttpLoaderServicesModule } from './services/ng-http-loader-services.module';
1414

src/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../package.json

src/services/ng-http-loader-services.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88
*/
99

10-
import { NgModule } from '@angular/core';
1110
import { CommonModule } from '@angular/common';
1211
import { HTTP_INTERCEPTORS } from '@angular/common/http';
12+
import { NgModule } from '@angular/core';
1313
import { PendingInterceptorService, PendingInterceptorServiceFactoryProvider } from './pending-interceptor.service';
1414
import { SpinnerVisibilityServiceFactoryProvider } from './spinner-visibility.service';
1515

src/services/pending-interceptor.service.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88
*/
99

10-
import { Injectable } from '@angular/core';
1110
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
12-
import { Observable } from 'rxjs/Observable';
13-
import { ReplaySubject } from 'rxjs/ReplaySubject';
11+
import { Injectable } from '@angular/core';
12+
import { Observable, ReplaySubject, throwError } from 'rxjs';
1413
import { catchError, finalize, map } from 'rxjs/operators';
15-
import 'rxjs/add/observable/throw';
1614

1715
@Injectable()
1816
export class PendingInterceptorService implements HttpInterceptor {
@@ -54,7 +52,7 @@ export class PendingInterceptorService implements HttpInterceptor {
5452
return event;
5553
}),
5654
catchError(error => {
57-
return Observable.throw(error);
55+
return throwError(error);
5856
}),
5957
finalize(() => {
6058
if (!shouldBypass) {

src/services/spinner-visibility.service.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
*/
99

1010
import { Injectable } from '@angular/core';
11-
import { Observable } from 'rxjs/Observable';
12-
import { ReplaySubject } from 'rxjs/ReplaySubject';
11+
import { Observable, ReplaySubject } from 'rxjs';
1312

1413
@Injectable()
1514
export class SpinnerVisibilityService {

src/spinkits.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88
*/
99

10-
import { SkCubeGridComponent } from './components/sk-cube-grid/sk-cube-grid.component';
1110
import { SkChasingDotsComponent } from './components/sk-chasing-dots/sk-chasing-dots.component';
11+
import { SkCubeGridComponent } from './components/sk-cube-grid/sk-cube-grid.component';
1212
import { SkDoubleBounceComponent } from './components/sk-double-bounce/sk-double-bounce.component';
1313
import { SkRotatingPlaneComponent } from './components/sk-rotating-plane/sk-rotating-plane.component';
1414
import { SkSpinnerPulseComponent } from './components/sk-spinner-pulse/sk-spinner-pulse.component';

test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
import 'zone.js/dist/zone-testing';
44
import { getTestBed } from '@angular/core/testing';
55
import {
6-
BrowserDynamicTestingModule,
7-
platformBrowserDynamicTesting
6+
BrowserDynamicTestingModule,
7+
platformBrowserDynamicTesting
88
} from '@angular/platform-browser-dynamic/testing';
99

1010
declare const require: any;
1111

1212
// First, initialize the Angular testing environment.
1313
getTestBed().initTestEnvironment(
14-
BrowserDynamicTestingModule,
15-
platformBrowserDynamicTesting()
14+
BrowserDynamicTestingModule,
15+
platformBrowserDynamicTesting()
1616
);
1717
// Then we find all the tests.
1818
const context = require.context('./test/', true, /\.spec\.ts$/);

test/components/sk-chasing-dots/sk-chasing-dots.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*/
99

1010
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
11-
import { SkChasingDotsComponent } from '../../../src/components/sk-chasing-dots/sk-chasing-dots.component';
1211
import { By } from '@angular/platform-browser';
12+
import { SkChasingDotsComponent } from '../../../src/components/sk-chasing-dots/sk-chasing-dots.component';
1313

1414

1515
describe('SkChasingDotsComponent', () => {

test/components/sk-cube-grid/sk-cube-grid.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*/
99

1010
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
11-
import { SkCubeGridComponent } from '../../../src/components/sk-cube-grid/sk-cube-grid.component';
1211
import { By } from '@angular/platform-browser';
12+
import { SkCubeGridComponent } from '../../../src/components/sk-cube-grid/sk-cube-grid.component';
1313

1414

1515
describe('SkCubeGridComponent', () => {

test/components/sk-double-bounce/sk-double-bounce.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*/
99

1010
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
11-
import { SkDoubleBounceComponent } from '../../../src/components/sk-double-bounce/sk-double-bounce.component';
1211
import { By } from '@angular/platform-browser';
12+
import { SkDoubleBounceComponent } from '../../../src/components/sk-double-bounce/sk-double-bounce.component';
1313

1414

1515
describe('SkDoubleBounceComponent', () => {

test/components/sk-rotating-plane/sk-rotating-plane.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*/
99

1010
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
11-
import { SkRotatingPlaneComponent } from '../../../src/components/sk-rotating-plane/sk-rotating-plane.component';
1211
import { By } from '@angular/platform-browser';
12+
import { SkRotatingPlaneComponent } from '../../../src/components/sk-rotating-plane/sk-rotating-plane.component';
1313

1414

1515
describe('SkRotatingPlaneComponent', () => {

0 commit comments

Comments
 (0)