angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

Ngfor with agm-circle

Open KumailHussain opened this issue 6 years ago • 1 comments

i want to generate n number of circles using ngfor with agm-circle but it throws error: Can't bind to 'ngFor' since it isn't a known property of 'agm-circle'. Seriously !!! here is my HTMl:

  <agm-circle *ngFor="data in circles"
                  [latitude]="data.lat"
                  [longitude]="data.lng"
                  [circleDraggable]="true"
                  [editable]="true"
                  [fillColor]="'data.color'"
                  [radius]="data.radius"
      >
      </agm-circle>

and data is:

this.circle = [ {lat: 51.79, lng: 7.8, radius: 60000, color: 'red'}, {lat: 52.79, lng: 12.8, radius: 60000, color: 'green'}, {lat: 54.79, lng: 10.8, radius: 60000, color: 'yellow'}, {lat: 51.79, lng: 8.8, radius: 60000, color: 'yellow'}, {lat: 60.79, lng: 7.8, radius: 60000, color: 'green'}, ];

KumailHussain avatar Sep 21 '17 13:09 KumailHussain

I think the error is that *ngFor should be used rather in that way *ngFor="let data of circles" and it should work.

olalew avatar Dec 07 '17 22:12 olalew