Q:

typescript: problems with angular.bind and map

I have the following code:
  function parseValueFromComplexType(complexType, item) {
                return item[complexType];
            }

In order to bind the value complextype, i use angular.bind
let parseValueFromComplexTypeWithValue = angular.bind('', parseValueFromComplexType , config.complexType);
val.values = val.values.map(parseValueFromComplexTypeWithValue);

Now typescript complains:

error TS2345: Argument of type 'Function' is not assignable to parameter of type '(value: any, index: number, array: any[]) => {}'. 

What does the error mean and how can i get rid of it? 

A:

The map function accepts a function with three parameters, in this structure:
callbackfn: (value: T, index: number, array: T[]) => U

The bind function of angular returns a simple Function type:
bind(context: any, fn: Function, ...args: any[]): Function;

The error say: You can't put just a Function where a callbackfn: (value: T, index: number, array: T[]) => U is expected. 
Another issue here is that you are trying to use angular bind in a very weird way... If you want to preserve the this just use an arrow function. 
Maybe something (Much simpler) like this:
var complexType = 'str';
val.values = val.values.map((item, index, array) => item[complexType]);

