Angularjs ui-gmap-window object data not showing

I have a problem with my ui-gmap-window in angularjs too. The problem is getting the object data in the window as it doesn't seem to render.

this is my allowance:

        <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>

      

and this is my angular:

 $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);
        };
    });
};

      

When I console.log my "Selectedmarker" object, it has all the data it should have. however nothing shows up in my u-gmap window.

Does anyone know what I am doing wrong here?

+3


source to share


1 answer


Another post came up with a similar problem and all that was missing was calling $ scope. $ apply () after setting the value for my "selectedmarker"



0


source







All Articles