When setting up an instance variable inside my Angular component like this:
@Component({
selector: 'app-root',
templateUrl: './app.component.html', //template: ``
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Welcome';
nombre1 : number;
}
A red line appears below nombre1
.
The error message reads:
Property 'nombre1' has no initializer and is not definitely assigned in the constructor.ts(256)
I'm having trouble identifying where I went wrong. Can someone please assist?