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
  • 857,932
  • 118
  • 1,152
  • 1,264
Mayur Randive
  • 611
  • 1
  • 10
  • 20

0 Answers0