Is it possible to pass a jQuery object as a constructor parameter to a typescript object?
<p>We are trying to figure out a peculiar behaviour of typescript. In the following two code examples, a jQuery object should be altered by typescript. In the example that works fine, we reference the jQuery object by using the selector engine in a method after our typescript class is instantiated. This works:</p>

<pre><code>namespace Company.Module {
    export class GenericService {
        private statefulObject: JQuery;

        public constructor( ) {
        }

        private _toggleObjectState(): void {
            this._statefulObject.toggleClass('text-hide text-success');
        }

        public SetObjectState(): void {
            this.statefulObject = $('#statefulObject');
            _toggleObjectState();
        }

    }
}
</code></pre>

<p>Whereas passing the jQuery object in the constructor does not work:</p>

<pre><code>namespace Company.Module {
    export class GenericService {
        private statefulObject: JQuery;

        public constructor( _statefulObject: JQuery ) {
            this.statefulObject = _statefulObject;
        }

        private _toggleObjectState(): void {
            this._statefulObject.toggleClass('text-hide text-success');
        }

        public SetObjectState(): void {
            _toggleObjectState();
        }

    }
}
</code></pre>

<p>We would like to understand why this is the case.</p>