Issue
I currently have a project where I have an angular workspace in which I have created an angular web app. Now I also needed an app and created an angular ionic app. I wanted to reuse my existing authentication service which uses AngularFireauth and AngularFirestore so I created a library and extracted the service. When using the service from the library in the angular web app everything works fine. But trying to inject the service in a page from the ionic app I get the error inject() must be called from an injection context. When moving the service from the library to the ionic app and just using it from there it works.
Ionic v.5.0.5
Angular v.9.0.6
Maybe someone has an idea.
Thanks for your help!
Solution
Just after asking the question i somehow found the answer at the bottom of a post which suggested adding
"paths": { "@angular/*": [ "./node_modules/@angular/*" ] }
to the tsconfig.app.json under the compilerOptions of the app where i was trying to inject the service.
Answered By - Patrick
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.