I have a function in my controller and it receives a parameter called let's say time, I'd like to refer to a ng-model in my scope based on that parameter.
What I have:
$scope.myFunction = function(){
$scope.minutes = 1;
}
What I want:
$scope.myFunction = function(time){
$scope.time = 1;
}
Where time is the parameter received and has the value minutes.
Thanks