Saturday, 7 September 2013

Proper anotation for Array of Objects in KnockoutJS usin TypeScript

Proper anotation for Array of Objects in KnockoutJS usin TypeScript

As, DefiantelyTyped types' definiitons were updated to use TypeSctipt with
Generics, what would be the proper type in the definition (as now only
ObservableArray of T is must):
class Some {
name: KnockoutObservable<string> = ko.observable("Some name"),
arrayOfValues: KnockoutObservableArray< (of Object??? ) > ???? ;
constructor () {
arrayOfValues.push( {key: "value"} );
...

No comments:

Post a Comment