Is there any style guide defining how to set default property values? Hopefully official.
class MyClass {
public foo = 'asdf';
}
and
class MyClass {
public foo: string;
constructor() {
this.foo = 'asdf';
}
}
both compile to
var MyClass = /** @class */ (function () {
function MyClass() {
this.foo = 'asdf';
}
return MyClass;
}());
The first is cleaner and similar to C# but the second is closer to the syntax of the compiled output ( and definition file if created) and the property type is explicit.
I've looked at https://www.typescriptlang.org/docs/home.html, https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines, and https://angular.io/guide/styleguide