When tryin to do a import, I get error codes which I do not know how to solve

Viewed 27

I have two problems the first is that when trying to import AuthService it says "Module '"./auth.service"' has no exported member 'AuthService"

code for the first problem:

import { TestBed } from '@angular/core/testing';

import { AuthService } from './auth.service';

code for the second problem:

import { PlayerComponent } from ".\component\player\player.component";
import { AddPlayerComponent } from "./components/add-player/add-player.component";
import { GuardService } from "./services/guard.service";
import { LoginComponent } from "./component/login/login.component";

The second problem is also with the imports, its says "Cannot find module". Im not really sure if I should write my code on here but this are my problems. How do I solve this?

1 Answers

You need to create an actual AuthService. Try running on the same level of your file ng generate service auth; this will generate a service and solve your issue!

Related