I am developing an Angualr application where we have a Map
object (as shown below). The key and value of the map object ( headerObj
) comes from the user as input to the application,
var headerObj = new Map(); headerObj.set(key,value);
I iterate over them using foreach, as shown below, the output goes as expected
$scope.inputHeaders.forEach(function (headerkey, headervalue) { console.log(headerkey, headervalue; });
but I have to show the values ββof this map in a user interface that the user can edit again, so I linked them
<li class="list-group-item" ng-repeat="header in inputHeaders"> <div ng-repeat="(key, value) in header"> {{key}} : {{value}} </div> </li>
I googled and tried several ways, but nothing helped, so basically I wanted to know how I can iterate over a map using forEach in angular?
Just for the sake of clarity, my requirement looks something like this: I need the values ββto be transmitted to the server as a key, a pair of values, only if I'm not mistaken, suppose that if I use the properties of the object, the object key will be fixed somehow like
{"key":"Content-Type","value":"application/x-www-form-urlencoded","$$hashKey":"003"}]
but my server is expecting something like
"Content-Type" => "application/x-www-form-urlencoded"
Created editing plunkr http://plnkr.co/edit/t2g6Dl831HGyjD6uSdf3?p=preview