title: How to modify angular $http.get().then response invalid JSON to valid JSON
body: <p>We need to implement type ahead functionality in inbox box ,but when we got response from $http get is invalid JSON so that i cant able do that.</p>
  
  <p>below method i am using for view level </p>
  
  <pre><code>uib-typeahead="name for name in collections ($viewValue)"
  </code></pre>
  
  <p><strong>Angular:</strong></p>
  
  <pre><code>$scope.collections = function(val) {
                      return $http.get('/Documents/DocumentsList/', {
                          params : {
                              stk : val
                          }
                      }).then(
                              function(response) {
                                  if (response.data.suggestions) {
                                      $("[uib-typeahead-popup].dropdown-menu").css('display','block');
                                      return response.data.suggestions
                                              .map(function(item) {
                                                  return item.term;
                                              });
                                  };
                              });
                  };
  </code></pre>
  
  <p><strong>JSON Response:</strong></p>
  
  <pre><code>{} &amp;&amp; {
      "name": "John",
      "age": 31,
      "city": "New York"
  }
  </code></pre>
  
  <p>How to modify the invalid JSON to valid JSON and pass the valid response in then.</p>