Setting: Angular 5+
Source: https://angular.io/tutorial
Within the heroes.component.ts
class, we see an assignment using a colon:
export class HeroesComponent implements OnInit {
heroes: Hero[];
However, in the app.component.ts
class, a different assignment method is used with the equal sign:
export class AppComponent {
title = 'app';
}
What is the reason behind this difference?