[Library | Trunk]: Add modal-select directive for modal mat-selects.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58729 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-05-20 12:54:02 +00:00
parent c7cdd48987
commit 5a261719c5
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,17 @@
import {Directive, Input, OnInit} from "@angular/core";
import {MatSelect} from "@angular/material/select";
@Directive({
selector: '[modal-select]'
})
export class ModalSelectDirective implements OnInit{
@Input() matSelect: MatSelect;
ngOnInit() {
this.matSelect._openedStream.subscribe( () => {
let divElement: HTMLDivElement = <HTMLDivElement>document.getElementsByClassName('cdk-overlay-container')[0];
divElement.classList.add('modal-select');
});
}
}

View File

@ -0,0 +1,10 @@
import {NgModule} from "@angular/core";
import {CommonModule} from "@angular/common";
import {ModalSelectDirective} from "./modal-select.directive";
@NgModule({
imports: [CommonModule],
declarations: [ModalSelectDirective],
exports: [ModalSelectDirective]
})
export class ModalSelectModule {}