Angularjs ui-gmap-window对象数据不渲染

Angularjs ui-gmap-window object data not rendering

本文关键字:数据 ui-gmap-window 对象 Angularjs      更新时间:2023-09-26

我在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中没有任何渲染。

有人知道我在这里做错了什么吗?

另一个帖子弹出了一个类似的问题,所有缺失的是调用,$scope.$apply()后设置一个值给我的"selectedmarker"