Accessing attributes from a page within a jquery-function

I would like to access an attribute within a jquery-function:

...
aCat : string = "pussy cat";

constructor(public navCtrl: NavController) {

    $(document).ready(function() {
        console.log('where is my ' + this.aCat);
    }
}
...

But i get just “where is my undefined” ? Actually it is possible to get the attribute with a jquery-closure, but i get the value not by reference, therefore i can’t modify it. Knows someone a solution ?

You just need to utilize Typescript’s fat arrow syntax:

    $(document).ready(() => {
        console.log('where is my ' + this.aCat);
    }

The fat arrow syntax retains the context of this.

Thanks. Works like a charme.