Update to RxJS 6
See original GitHub issueRxJS 6.x has changed how we import its modules and operators, causing this package to throw some errors. Should just be a matter of adjusting the imports:
ERROR in node_modules/ng-block-ui/lib/services/block-ui-instance.service.d.ts(1,10): error TS2305: Module ‘“C:/Dev/testblockui/node_modules/rxjs/Observable”’ has no exported member ‘Observable’. node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module ‘rxjs-compat/Observable’.
Fixing this import gives way to more errors:
ERROR in ./node_modules/ng-block-ui/lib/services/block-ui-instance.service.js Module not found: Error: Can’t resolve ‘rxjs/ReplaySubject’ in ‘C:\Dev\testblockui\node_modules\ng-block-ui\lib\services’ ERROR in ./node_modules/ng-block-ui/lib/components/block-ui-content/block-ui-content.component.js Module not found: Error: Can’t resolve ‘rxjs/add/operator/map’ in ‘C:\Dev\testblockui\node_modules\ng-block-ui\lib\components\block-ui-content’
package.json:
"dependencies": {
"@angular/animations": "^6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",
"core-js": "^2.5.4",
"ng-block-ui": "^1.0.4",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26"
},
Steps to reproduce:
ng new testblockui
npm install ng-block-ui --save
Add the import to app.module:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { BlockUIModule } from 'ng-block-ui';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BlockUIModule.forRoot()
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Serve:
ng serve
App generated with Angular CLI: Angular CLI: 6.0.0 Node: 8.11.1 OS: win32 x64
Note: edited several times for spelling and clarity
Issue Analytics
- State:
- Created 5 years ago
- Comments:21 (13 by maintainers)
Top GitHub Comments
I have published
ng-block-ui@2.0.0-beta.1
which adds support for Angular 6 and RXjs 6. Please install (npm i --save ng-block-ui@next
) and try it out in your Angular 6. Let me know if any of you run into any issues.@tamilsweet, I have looked into this and I am now working on a
2.0.0
version. Which will support the new version of rxjs.