I just did it in TypeScript 1.3 (although it should work in older versions too):
pendingAddAssociations: KnockoutObservableArray<ControllerModel> = ko.observableArray<ControllerModel>([]);
for your example, if you have an agency class.
export class IndexPageViewModel { agencies: KnockoutObservableArray<Agency>; constructor () { this.agencies = ko.observableArray<Agency>([]); } }
I also found that you can use any of this.agencies = <any>[]; . This is useful if you are using the ES5 knockout plugin .
Aligned
source share