I have a defined function.
$scope.myFunction=function(){
alert("works")
}
I have a variable called $scope.myVar
and this contains an string that is a function.
$scope.myVar="myFunction()";
How can I call the function directly from a variable ($scope.myVar
) and not from the defined function($scope.myFunction
)?
something like:
$scope.myVar();
this is my code..
$scope.myFunction=function(){
alert("works")
}
$scope.myVar="myFunction()";
//Execute this:
//$scope.myVar() I dont know