Closed bruiztorres closed 5 years ago
Hey Borga, thanks for the PR! I can see that the demo is working, but when I try to use your updated branch in my app, I get the following console error:
Error: StaticInjectorError(AppModule)[NgGridItem -> KeyValueDiffers]:
StaticInjectorError(Platform: core)[NgGridItem -> KeyValueDiffers]:
NullInjectorError: No provider for KeyValueDiffers!
Have you seen the same? Any ideas what I might be doing wrong? (I'm not using KeyValueDiffers in my app, so this is from angular2-grid.) Thanks!
At this point, I haven’t been able to reproduce the error you mentioned above.
@ThomasSchellenbergNextCentury I found an issue in stackoverflow that could be related. Could you try to do a fresh installation removing the node_modules folder.
In any case, I will dig into the issue trying to reproduce it.
@ThomasSchellenbergNextCentury Could you let me know the way you are using this branch? I have played with different scenarios and haven't been able to reproduce the error you mentioned above.
Hey @borgitas21 ,
Sorry, I fixed my problem and meant to post about it but forgot!
The stackoverflow issue you linked helped a lot. My problem was due to the way I had imported the dependency into my project included a second node_modules folder. I fixed the problem by committing the updated code to a deployment branch on my fork (without the node_modules folder).
Thanks for your help and for checking-in!
Thomas
Great, good to know ;)
Any updated on this?
@BTMorton any update on this? This is really a great library; however it is sad that it prevents us from migrating our project from Angular 4 to Angular 6, and only angular2-grid among among 54 libraries that we use for our project has no support for Angular 6. We look forward to any update on this. Thanks in advance.
@BTMorton are you missing something in this PR? Please let me know if I can help to merge it.
@BTMorton We have the same issue with this library. It's wonderful and we're using it for quite some time now but it's sad that it's broken with Angular 6. This means that we have to drop the functionality which depends on this library because we have to upgrade to Angular 6 for other reasons.
If you need help completing this PR please let me know!
I found an ugly workaround. It is useful at least till we get an upgrade for angular2-grid.
First install replace
as dev dependency.
npm install replace --save-dev
Create a bash script file (eg. angular2-grid-fix.sh) in the same dir with package.json file, and copy/paste the following content to bash script file.
./node_modules/replace/bin/replace.js 'import { Observable } from "rxjs/Observable"' 'import { fromEvent } from "rxjs"' ./node_modules/angular2-grid/directives/NgGrid.js
./node_modules/replace/bin/replace.js 'import "rxjs/add/observable/fromEvent";' '' ./node_modules/angular2-grid/directives/NgGrid.js
./node_modules/replace/bin/replace.js 'Observable.fromEvent' 'fromEvent' ./node_modules/angular2-grid/directives/NgGrid.js
Add the following line to scripts
entry in package.json file.
"postinstall": "./angular2-grid-fix.sh"
Edit: The solution above might cause some problems across different operating systems due to file separator. So, instead of bash script, You can create a node file called "angular2-grid-fix.js" within the same directory with package.json file with the following content:
var replace = require("replace");
replace({
regex: 'import { Observable } from "rxjs/Observable"',
replacement: 'import { fromEvent } from "rxjs"',
paths: ['./node_modules/angular2-grid/directives/NgGrid.js'],
silent: false
});
replace({
regex: 'import "rxjs/add/observable/fromEvent";',
replacement: '',
paths: ['./node_modules/angular2-grid/directives/NgGrid.js'],
silent: false
});
replace({
regex: 'Observable.fromEvent',
replacement: 'fromEvent',
paths: ['./node_modules/angular2-grid/directives/NgGrid.js'],
silent: false
});
Then you can add it to the scripts
entry in package.json file. So it is executed automatically after npm install
is completed.
"postinstall": "node ./angular2-grid-fix.js"
@BTMorton please save us from such ugly workarounds.
@BTMorton 's last activity in GitHub was on 31st Aug. I hope he didn't leave the World.
@BTMorton 's last activity in GitHub was on 31st Aug. I hope he didn't leave the World.
Hopefully, He is ok :)
Not dead, just burn out. v3.0.0 with full angular v6 support published.
@BTMorton You are the MAN. Thanks a lot.