Angular – Access elementRef of MatMenu

I have the following setup: @Directive({ selector: ‘[test]’ }) export class Test { constructor( private hostRef: ElementRef, private host: MatMenuTrigger, ) {} ngOnInit() { => { /* Do something with the MatMenu elementRef */ }); } } <a [matMenuTriggerFor]="aMenu" test></a> <mat-menu #aMenu></mat-menu> I want to get the ElementRef of the MatMenu (not a reference […]

By Sadiinso
Categorized as angular, angular-material Tagged ,

How to modify CSS variable in an angular animation state

I’m creating a "draggable" component which can be moved on the page and plays an animation when destroyed. I am curently setting the style.transform attribute of the component host to translate3d to change its position on the document: @Component({ selector: ‘app-window’, templateUrl: ‘./window.component.html’, styleUrls: [‘./window.component.scss’], animations: [ trigger(‘WindowAnimation’, [ state(‘void’, style({ opacity: ‘0’, transform: ‘scale(0)’, […]

By Sadiinso
Categorized as angular, animation, css Tagged , ,

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us