What is the difference between initialzing a component's property directly in the component class VS initializing it in the ngOninit method ?
Example :
@Component({})
export class AppComponent {
property: string = 'some initial value'
}
**VS**
@Component({})
export class AppComponent implements OnInit{
property: string;
ngOninit(): void {
this.property = 'some initial value';
}
}