import {Component, ElementRef, Input, OnInit} from '@angular/core'; declare const $: any; @Component({ selector: '[siteMenuItem]', templateUrl: './template.html', styleUrls: ['./style.less'] }) export default class SiteMenuItem implements OnInit { @Input() label: string = ''; @Input() icon: string = ''; element: any; constructor(private el: ElementRef) { this.element = el.nativeElement; this.element.classList.add('site-menu-item') } ngOnInit(): void { $(this.element).on('mouseenter mouseleave', function () { $(this).toggleClass('hover') }) } }