I need to call a function from an object with a string. For example:
type = 'human'
json: {
action: 'run',
type: this.type, //<- Here I want to call a function call
'Human', or whatever value has the variable type.
}
Basically I want to parse the string and call the function that matches the string.
This is for angular. I'm trying to use window['function'] name but it angular says its not a function.
Thank you!