Error: No provider for location
See original GitHub issueHey there,
I followed the instructions in your README.md to install this plugin in my Angular 2 application.
I keep getting this error:
ORIGINAL EXCEPTION: No provider for Location! (Angulartics2 -> Location)
Is it because I’m using ngrx/router instead of angular2/router ?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:20 (2 by maintainers)
Top Results From Across the Web
App testing return "NullInjectorError: No provider for Location!"
I have imported Location from the wrong place so the error has appeared. ... An alternative to NullInjectorError: No provider for Location!
Read more >NG0201: No provider for {token} found! - Angular
You see this error when you try to inject a service but have not declared a corresponding provider. A provider is a mapping...
Read more >[Debugging] NullInjectorError: No provider for {Class}!
In this video, you'll learn what the error "NullInjectorError: No provider for {Class}!" means, how to debug it, and prevent it from ...
Read more >NullInjectorError: No provider for Geolocation - Ionic Native
Hello,. I am receiving the following error when attempting to test with Ionic Native Geolocation as a dependency:
Read more >How to fix angular error main.js:1 NullInjectorError
js:1 NullInjectorError: No provider for i! This error occurs in Angular when you create a singleton service and implement ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes. You need
Add
Locationto your bootstrap array.For anyone else still hitting this problem but not using routes in your app, make sure to initialize the Router Module correctly and pass an empty array:
This example is a feature module that uses
forRoot. I haven’t tested it, but I bet that if your App Module is using forRoot, your “MyModule” module will probably needforChild