@angular/cdk/overlay#GlobalPositionStrategy TypeScript Examples
The following examples show how to use
@angular/cdk/overlay#GlobalPositionStrategy.
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: loader.service.ts From nodejs-angular-typescript-boilerplate with Apache License 2.0 | 6 votes |
open(): OverlayRef {
if (this.overlayRef) {
return this.overlayRef;
}
const positionStrategy: GlobalPositionStrategy = this.overlay
.position()
.global()
.centerHorizontally()
.centerVertically();
const overlayConfig = new OverlayConfig({
hasBackdrop: true,
positionStrategy,
});
const overlayRef = this.overlay.create(overlayConfig);
const portal = new ComponentPortal(SpinnerLoaderComponent);
overlayRef.attach(portal);
this.overlayRef = overlayRef;
return this.overlayRef;
}
Example #2
Source File: dialog-ref.ts From alauda-ui with MIT License | 5 votes |
private getPositionStrategy(): GlobalPositionStrategy {
return this.overlayRef.getConfig()
.positionStrategy as GlobalPositionStrategy;
}