How to printout to html(angularjs) 'name' string as loop in the following code?
When I printed overwrited scope array, more than one printed last string.
var createMarker = function (place) {
var request = {
reference: place.reference
};
var detail = new google.maps.places.PlacesService($scope.map.control.getGMap());
detail.getDetails(request, function(result, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
$scope.map.markers.push({
latitude: place.geometry.location.lat(),
longitude: place.geometry.location.lng(),
showWindow: false,
name: result.name,
phone: result.formatted_phone_number,
website: result.website,
html: result.html_attributions[0],
type: result.types.toString()
});
$scope.$apply();
$ionicLoading.hide();
}
});
Thanks.