While trying to compile my code, I encountered the following error:
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
@Injectable()
export class TaskService {
constructor(private http: HttpClient) {
}
getTasks() {
return this.http.get('/api/tasks');
}
}
An error occurred in src/app/tasks/task.service.ts(4,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
I'm unsure about what went wrong... it seems like there's an issue with the @ symbol before Injectable at 4,1.