After initializing a fresh Aurelia project using the aurelia-cli
and executing the au new
command, I received the following app.ts
:
export class App {
message = 'Hello World!';
}
To enhance my app.ts
, I replaced it with the code from a helpful tutorial. The updated code now looks like this:
export class App {
constructor() {
this.message = 'Hello World!';
this.firstName = "Animesh";
this.lastName = "Bulusu";
}
get fullName() {
return `${this.firstName} ${this.lastName}`;
}
}
When refreshing the page, everything displays correctly. However, I notice some errors in the console:
Property 'message' does not exist on type 'App'.
Property 'lastName' does not exist on type 'App'.
Property 'lastName' does not exist on type 'App'.
The errors disappear if I eliminate the constructor and directly declare the variables within the class. What is causing this behavior, and how can I eliminate these errors?