Я работаю в угловых 7. Я получаю ошибку при компиляции.Я проверил круговую зависимость, Injectable () декоратор.Там нет неиспользованной зависимости.Я использовал @Injectable () в моем сервисе.Для вашей информации, я использую Mac.Я не могу найти решение.
Мой код указан ниже:
auth.service.ts
import { Router } from '@angular/router';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpErrorResponse } from '@angular/common/http';
import { HttpService } from '../common/modules/http-with-injector/http.service';
import { UserData } from '../common/modules/auth/auth.module';
import { dcrypt } from '../common/_classes/functions';
@Injectable()
export class AuthService {
user: any;
constructor(
private router: Router,
private http: HttpService,
) {}
}
component.ts
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { AuthService } from '../auth.service';
import * as $ from 'jquery';
import { Router } from '@angular/router';
import { ScriptLoaderService } from 'src/app/common/script-loader.service';
import { AlertService } from 'src/app/common/modules/alert/alert.service';
import { Helpers } from 'src/app/common/helpers';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
model: any = {
email: '',
password: ''
};
loading = false;
@ViewChild('hasAlert', { static: true }) alertContainer: ElementRef;
constructor(
private _script: ScriptLoaderService,
private router: Router,
private alert: AlertService,
private authService: AuthService,
) {
this.getSettings();
}
}
Пожалуйста, помогите мне решить проблему.