- Home
- Forum
- Angular - EJ 2
- Sample does not work out of the box (from syncfusion github)
Sample does not work out of the box (from syncfusion github)
Hi,
wanted to play around with tree grid to see if this is suitable for my need, but provided sample repo does not work properly.
Tried running with the newest verstion of "^19.1.58", but still fails.
Steps:
Clone repo
npm install
npm start
open localhost:4200
and you will get:
main.ts:12 Error: inject() must be called from an injection context
at injectInjectorOnly (core.js:4708)
at ɵɵinject (core.js:4718)
at Module.ɵɵdirectiveInject (core.js:14619)
at NodeInjectorFactory.TreeGridComponent_Factory [as factory] (ej2-angular-treegrid.js:486)
at getNodeInjectable (core.js:3596)
at instantiateAllDirectives (core.js:10280)
at createDirectivesInstances (core.js:9629)
at Module.ɵɵelementStart (core.js:14837)
at AppComponent_Template (app.component.html:1)
at executeTemplate (core.js:9600)
Same for me. Building on following Angular version:
Angular CLI: 11.2.6
Node: 15.5.0
OS: win32 x64
Package Version
@angular-devkit/architect 0.1102.6 (cli-only)
@angular-devkit/core 11.2.6 (cli-only)
@angular-devkit/schematics 11.2.6 (cli-only)
@schematics/angular 11.2.6 (cli-only)
@schematics/update 0.1102.6 (cli-only)
Also created an issue on your gthub:
Unfortunately this is not correct answer.it is not related with node version.
This answer is correct
https://stackoverflow.com/questions/67189702/syncfusion-treegrid-angular-11-error-inject-must-be-called-from-an-injecti
|
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": [],
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
} |
The workaround mentioned above ist not needed if the installed Angular version is <= 12.2.8.
I use use ~12.2.8 as version definition for Angular. So it might that after npm update I get a newer version. Currently the verison is 12.2.13 (wanted version). Then this workaround above is needed. I want to prevent the use of this workaround.
Why are Syncfusion packages locked to a maximum version e.g. 12.2.8 and not to ~12.2.8?
After following the above reference, still faced issue please share us the following details.
- Share the package.json details.
- If possible, reproduce the issue in the attached sample or share the issue reproducible sample.
- Share the product detail version.
Hi Pon Selva,
to be honest, I currently cannot reproduce the issue anymore in none of my projects. It works. Previously I hat installed latest version of node. Maybe version 16 had this kind of issues since angular 12 works with 14
Regards,
Michael
We are glad that your query has been resolved. So, as in previous update we suggest you to use the latest version possible. Kindly get back to us for further assistance.
Jagadesh Ram
- 8 Replies
- 4 Participants
- Marked answer
-
MS Michal Szkudlarek
- Apr 28, 2021 11:46 AM UTC
- Nov 23, 2021 12:44 PM UTC