title: 'filter' filter in AngularJS
body: <p>I have an array of objects and I want to extract the value when key is passes in 'filter' filter. Below is the controller code snippet I have tried, but the type of response I get is undefined. Please help me in finding where am I going wrong.</p>
  
  <pre><code>var states =  [{"HIMACHAL PRADESH":"HP"},{"JAMMU AND KASHMIR":"JK"},{"JHARKHAND":"JH"},{"KARNATAKA":"KA"},{"KERALA":"KL"},{"MADHYA PRADESH":"MP"},{"MAHARASHTRA":"MH"},{"ORISSA":"OR"}]
  var str = "ORISSA";
  var abbr = $filter('filter')(states, {key: str}, true).value;
  console.log ("ABBR:"+abbr);
  </code></pre>
  
  <p>P.S. I have injected $filter in the controller</p>