Closed yringler closed 4 years ago
Any ideas @maxi7587 ? You check v2.1x work with angular 8?
Same here. Removing the autoregister()
annotation with :
@Injectable({
providedIn: 'root'
})
make things work.
Tested with 2.1 and Angular 8.x
You can use providedIn to provide the service in the app root instead of placing it in your NgModule, but you'll still have to register it using @Autoregister()
or .register()
(the second one in the service's constructor.
This is because the library creates a map using the service's type when you register it. This map is used when calling getService()
from a resource, for example, when receiving a resource from the back-end.
Replicated at https://github.com/yringler/ngx-issue-replicate
ng test fails with
Changing typescript target to es5, as per related issues below, fixes this. That should not be needed; it causes bigger builds, and means that ngx-jsonapi doesn't work out of the box with angular.
After changing to es5, I get error
Also, the README reccomends using
@Injectable()
unstead ofDoing so causes error in test
Related Issues have a similar error, and tell to change typescript target to es5.:
https://github.com/bugsnag/bugsnag-js/issues/505 is possibly relevant, also.
Replicate