I'm trying to build a simple app with angular2, I have the below component:
@Component({
selector: 'map-menu',
templateUrl: './angular-app/components/map-menu.html'
})
export class MapMenuComponent {
@Input() selectedMarkers: Array<google.maps.Marker>;
constructor() {
// setInterval(() => {
// console.log(this);
// }, 1000);
}
}
when my map-menu.html is:
<ul class="nav nav-sidebar">
<li *ngFor="#marker of selectedMarkers #i = index"><a href="#">{{marker.data.name}}</a></li>
</ul>
and in my app html I have:
<map-menu [selectedMarkers]="selectedMarkers"></map-menu>
and the list is not being updated, BUT when I'm adding the commented setInterval it is working fine. what am I missing there?
I've created a plunker with the solution