Here is the code I am using:
class ProjectInput {
private templateElement: HTMLTemplateElement;
private hostElement: HTMLDivElement;
constructor() {
this.templateElement = document.getElementById('project-input')! as HTMLTemplateElement;
this.hostElement = document.getElementById('app')! as HTMLDivElement;
}
}
I am receiving this error when I try to compile it:
I am using the properties already in the constructor. If I removed the private modifier, no errors are generated. I still need to declare them as private though.
You say you are using these variable in the constructor, but you are not. You are declaring them, but not using them. At this time, those variable do seem useless. If you don't plan on using them any further, then they should just be deleted.