0

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.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
Mayur Randive
  • 633
  • 1
  • 10
  • 20

0 Answers0