Loops only show the last JSON data and I can not resolve it, hope someone can help me and tell me what's wrong am I, thank you.
<script>
angular.module('ngMap').run(function($rootScope) {
$rootScope.mouseover = function() {
console.log('mouseover', this);
this.style.backgroundColor = 'grey';
};
$rootScope.mouseout = function() {
this.style.backgroundColor = 'white';
};
$rootScope.click = function() {console.log('click')};
for (var i = 0; i < map_data.length; i++) {
$rootScope.customMarkers = [
{address: map_data[i].work_address, "class": "my1"},
];};
});
</script>