Sarja
Sarja

Reputation: 1

ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)

[[There are the service.ts, app.module.ts, an the errorenter image description here](https://i.sstatic.net/kyR2D.png)](https://i.sstatic.net/JvKcm.png)

I have this problem. i tried to importing the services in providers (without providedIn in the injectable), importing HttpClientModule in the app.module.ts, using providedIn: 'root' in the @Injectable and the error remain. Do you know what can i do?

Upvotes: 0

Views: 97

Answers (1)

Ranushan Rachu
Ranushan Rachu

Reputation: 66

You need to put decorator @Injectable before you declaring your class (service for this case)

@Injectable({
    providedIn: ‘root’
})
export class RegisterService {…}

Upvotes: 0

Related Questions