Can angular 4 have dynamic ng-content. Can some provide a way to remove static slide1,slide2 so that it can be implemented by *ngFor
Content of child component:
<ion-slides [pager]="true" #Slides (ionSlideDidChange)="onSlideChanged()">
<ion-slide class="slide1">
<ng-container *ngIf="!isMenuOpen">
<ng-container *ngTemplateOutlet="slide1"></ng-container>
</ng-container>
</ion-slide>
<ion-slide class="slide2">
<ng-container *ngIf="!isMenuOpen">
<ng-container *ngTemplateOutlet="slide2"></ng-container>
</ng-container>
</ion-slide>
</ion-slides>
<ng-container *ngIf="isMenuOpen">
<div class="sidemenu-open-slide slide1" *ngIf="isMenuOpen && slideActiveIndex==0">
<ng-container *ngTemplateOutlet="slide1"></ng-container>
</div>
<div class="sidemenu-open-slide slide2" *ngIf="isMenuOpen && slideActiveIndex==1">
<ng-container *ngTemplateOutlet="slide2"></ng-container>
</div>
<div class="side-menu-slider-pagination">
<button class="swiper-pagination-bullet" *ngFor="let page of [0,1]" style="margin: 0 5px;" [ngClass]="{'swiper-pagination-bullet-active':slideActiveIndex==page}"></button>
</div>
</ng-container>
<ng-template #slide1>
<ng-content select="[slide1]"></ng-content>
</ng-template>
<ng-template #slide2>
<ng-content select="[slide2]"></ng-content>
</ng-template>
In My parent component
<customslider slides="2">
<div slide1>
</div>
<div slide2>
</div>
</customslider>
I just want that my the below case should be handled
<customslider slides="N">
<div slide1>
</div>
<div slide2>
</div>
<div slideN>
nth slide
</div>
</customslider>
Sorry, you want something like?
in another component you use, e.g.