I'm still new to Angular and recently I have been trying to make a login system that goes to another page. But unfortunately, I can't quite get to that stage yet as I have this problem in my code.
import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../services/auth.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent implements OnInit {
constructor(public authservice: AuthService, private router: Router) { }
ngOnInit(): void {
}
}
the error that i keep getting from the vscode is:
Cannot find module '../../services/auth.service' or its corresponding type declarations
However, when i try to login to another page, it does not share the similar error.
import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../services/auth.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-userinfo',
templateUrl: './userinfo.component.html',
styleUrls: ['./userinfo.component.css']
})
export class UserinfoComponent implements OnInit {
constructor(public authservice: AuthService, private router: Router) { }
ngOnInit(): void {
}
}