I have been working for a while with Angular but can\'t find a definitive recommendation on :
Initializing member variables inline vs in the constructor
It's a personal style preference.
Initializing a property in the constructor allows you to leverage constructor parameters when you're initializing the property.
Initializing a property inline is more concise, and keeps the default value of the property more in context with its declaration.
TypeScript compiler just brings values initialized inline inside the constructor https://www.typescriptlang.org/play/
There is no difference basically, its just the convenience. Only difference for using constructor
initialization is you can pass the value dynamically and then assign to it.
constructor(visible) {
this.isVisible = visible; // <-- vs initialization in the constructor
}