@angular/cdk/overlay#ScrollStrategy TypeScript Examples

The following examples show how to use @angular/cdk/overlay#ScrollStrategy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: tour-anchor-opener.component.ts    From ngx-ui-tour with MIT License 6 votes vote down vote up
export function scrollFactory(overlay: Overlay, tourService: NgxmTourService): () => ScrollStrategy {
  return () => {
    const step = tourService.currentStep,
        scrollStrategies = overlay.scrollStrategies,
        disablePageScrolling = !!step.disablePageScrolling;

    return disablePageScrolling ? scrollStrategies.block() : scrollStrategies.reposition();
  };
}
Example #2
Source File: app.module.ts    From svg-path-editor with Apache License 2.0 5 votes vote down vote up
@NgModule({
  declarations: [
    AppComponent,
    ExpandableComponent,
    CanvasComponent,
    OpenComponent,
    OpenDialogComponent,
    SaveComponent,
    SaveDialogComponent,
    ExportComponent,
    ExportDialogComponent,
    UploadImageComponent,
    UploadImageDialogComponent,
    FormatterDirective,
    KeyboardNavigableDirective
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    FormsModule,
    MatInputModule,
    MatButtonModule,
    MatFormFieldModule,
    MatIconModule,
    MatCheckboxModule,
    MatMenuModule,
    MatTooltipModule,
    MatDialogModule,
    MatTableModule,
    MatSortModule,
    MatSliderModule,
    BrowserAnimationsModule,
    ScrollingModule,
    ServiceWorkerModule.register('ngsw-worker.js', {
      enabled: environment.production,
      // Register the ServiceWorker as soon as the app is stable
      // or after 30 seconds (whichever comes first).
      registrationStrategy: 'registerWhenStable:30000'
    })
  ],
  providers: [{
    provide: MAT_TOOLTIP_SCROLL_STRATEGY,
    deps: [Overlay],
    useFactory(overlay: Overlay): () => ScrollStrategy {
      return () => overlay.scrollStrategies.close();
    }
  }],
  bootstrap: [AppComponent]
})
export class AppModule { }
Example #3
Source File: color-picker.component.ts    From angular-material-components with MIT License 5 votes vote down vote up
private _scrollStrategy: () => ScrollStrategy;
Example #4
Source File: color-picker.component.ts    From angular-material-components with MIT License 5 votes vote down vote up
export function NGX_MAT_COLOR_PICKER_SCROLL_STRATEGY_FACTORY(overlay: Overlay): () => ScrollStrategy {
  return () => overlay.scrollStrategies.reposition();
}
Example #5
Source File: color-picker.component.ts    From angular-material-components with MIT License 5 votes vote down vote up
NGX_MAT_COLOR_PICKER_SCROLL_STRATEGY =
  new InjectionToken<() => ScrollStrategy>('ngx-mat-colorpicker-scroll-strategy')
Example #6
Source File: datetime-picker.component.ts    From angular-material-components with MIT License 5 votes vote down vote up
private _scrollStrategy: () => ScrollStrategy;
Example #7
Source File: datetime-picker.component.ts    From ngx-mat-datetime-picker with MIT License 5 votes vote down vote up
private _scrollStrategy: () => ScrollStrategy;