M
M
Max2017-05-24 23:13:53
Angular
Max, 2017-05-24 23:13:53

Yandex maps, AngularJS. Why does it give an error?

There is a json file, in it, among the properties, each object has an index and coordinates in the getObjects object. I want to add these coordinates to the Yandex map, this is done through the ya-source = "..." Attr. The question is, how can I write an expression in ya-source so that it takes the getObjects value of each array element from json? something like this...
tried like this

<div ng-repeat="shop in $ctrl.shopsCatalog">
        <ya-geo-object ya-source={{shop.geoObjects}}
                       ya-options="{preset: 'islands#icon',iconColor: '#0095b6'}">
        </ya-geo-object>
    </div>

the console swears that the expression is written incorrectly
angular.js:14199 Error: [$parse:syntax] Syntax Error: Token '{' invalid key at column 2 of the expression [{{shop.geoObjects}}] starting at [{shop.geoObjects}}].

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question