<div appIntersectionDetection
     detectionType="top"
     [intersectionContainer]="pagesContainer"
     (intersecting)="onIntersection($event)">
  <app-section *ngFor="let section of page.sections; let i = index"
               [parentForm]="pageForm"
               [parentArrayIndex]="i"
               [section]="section"
               [ngStyle]="{
                  position: 'relative',
                  display: section.dynamicPositioning ? 'contents' : 'block',
                  overflow: 'auto',
                  width: '100%',
                  'background-color': section.backgroundColor,
                  'min-height': section.dynamicPositioning ? 'auto' : section.height + 'px'}">
  </app-section>
</div>
<div appIntersectionDetection
     detectionType="bottom"
     [intersectionContainer]="pagesContainer"
     (intersecting)="onIntersection($event)"
></div>