Opposed to my expectation I can't access my class field myLibrary in the class method initialize().
class ViewController {
myLibrary = new Library();
initialize() {
console.log(myLibrary); // undefined
The only "solution" I found was to declare myLibrary outside of the class as a global variable. Is there a way to declare fields in a class and then, well, use them?