import { ObservableArray } from "tns-core-modules/data/observable-array" ; import { Observable } from "tns-core-modules/data/observable" ; import { DataItem } from "./data-item" ; export class ViewModel extends Observable { constructor ( ) { super ( ) ; this . dataItems = new ObservableArray < DataItem > ( ) ; for ( let i = 0 ; i < 100 ; i ++ ) { this . dataItems . push ( new DataItem ( i , "Item " + i ) ) ; } } get dataItems ( ) : ObservableArray < DataItem > { return this . get ( "_dataItems" ) ; } set dataItems ( value ) { this . set ( "_dataItems" , value ) ; } }