Angularjs2 array and Typescript

This is means that model field will have type :any and you will be able to assign anything to it. In this case model:any = {}; it declares new field model that contains empty object.

To set an array you need to use model:Array = [];. You can also add type for your Array: model: Array<number> = [];

Leave a Comment