You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the `JsonApiModule` to your app module imports:
68
+
### Migrate to version 18+
69
+
70
+
Version 18 does not expose the module because it has been removed. Therefore, you need to remove all imports of the `JsonApiModule`.
71
+
72
+
Additionally, ensure that `HttpClientModule` is provided in your application, as it was previously imported and re-exported by `JsonApiModule`.
73
+
74
+
### Angular CLI configuration (for CLI 8.1+)
75
+
76
+
Beginning from Angular CLI 8.1 the `tsconfig.json` does not sets the `emitDecoratorMetadata` option (see https://blog.ninja-squad.com/2019/07/03/angular-cli-8.1/#typescript-configuration-changes). But we need it to read the metadata from the models. So make sure to update your `tsconfig.json`:
77
+
78
+
```json
79
+
{
80
+
"compilerOptions": {
81
+
"emitDecoratorMetadata": true,
82
+
}
83
+
}
84
+
```
85
+
86
+
### Notice for `es2015` compilation
87
+
88
+
Beginning with Angular 8 the default compile target will be `es2015` (in `tsconfig.json`).
89
+
Make sure to add this line in your `src/polyfills.ts` as we need it to read metadata from the models:
**Warning**: If you have circular dependencies in your model definitions (see https://github.com/ghidoz/angular2-jsonapi/issues/236#issuecomment-519473153 for example), you need to change the compile target to `es5` as this lead to runtime errors `ReferenceError: Cannot access 'x' before initialization` (see https://github.com/angular/angular/issues/30106#issuecomment-497699838).
0 commit comments