Generic type 'Array<T>' requires 1 type argument(s). - Angular2 Generic type 'Array<T>' requires 1 type argument(s). - Angular2 angular angular

Generic type 'Array<T>' requires 1 type argument(s). - Angular2


solution 1:

clients: String[]; // if type cant be determined use 'any[]'    doctors: String[];

solution 2:

clients: Array<String>; // if type cant be determined use '<any>'    doctors: Array<String>;


I have not used Angular2, but I believe the solution, since you know the type which the array is going to hold, is to use Array<String> instead of array on its own.

NOTE: what you could do is replace String with the angular2 typename for a string primitive.