Let's say I have a function which returns the value of a key I pass into it as a variable.
$scope.data = {"name":"Mayur","Age":25,"Location":"Pune"}    
$scope.showValue = function(key) {
  return  data.key   
}
showValue('name')  // it should return Mayur
I have sent key from html view and expecting it to return me its corresponding value.
 
    