3
我有和angularjs中的ui-gmap-window問題。 問題是將對象數據放入窗口中,因爲它不會呈現。Angularjs ui-gmap-window對象數據無法渲染
這是我加價:
<ui-gmap-window coords="selectedmarker.coords" options="windowOptions" closeClick="closeClick()" show="windowOptions.show">
<div style="overflow: auto; width: 300px;">
<h2 style="font-size: 12px">{{selectedmarker.title}}</h2>
<h2 style="font-size: 12px">ADRESS:</h2>
<span>{{selectedmarker.addressStreet}}</span>
<br/>
<span>{{selectedmarker.addressZip + ' ' + selectedmarker.addressCity}}</span><br/>
<span>{{'Telefon: ' + selectedmarker.phoneNumber}}</span><br/>
<span>{{'E-postadress: ' + selectedmarker.email}}</span>
<h2 style="font-size: 12px">ÅTERFÖRSÄLJARE AV:</h2>
<span>{{selectedmarker.products}}</span>
</div>
</ui-gmap-window>
<ui-gmap-markers click="'onClick'" models="retailersService.foundRetailers.retailers" coords="'coords'" icon="'icon'" idKey="id">
</ui-gmap-markers>
,這是我的角度:
$scope.selectedmarker = {};
$scope.onClick = function (data) {
$scope.windowOptions.show = !$scope.windowOptions.show;
$scope.selectedmarker = data;
};
//call the on-click-funcionality with my collection of objects.
$scope.addMarkerClickFunction(mycollection);
//On-click-functionality
$scope.addMarkerClickFunction = function (mycollection) {
angular.forEach(mycollection, function (value, key) {
value.onClick = function() {
$scope.onClick(value);
};
});
};
當我CONSOLE.LOG我「Selectedmarker」反對它擁有所有它應有的數據。但是在我的ui-gmap-window中沒有任何東西呈現。
有沒有人知道我在做什麼錯在這裏?
之後申請()是ü能解決這個問題? –