You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mohemm_moe/Mohem/src/app/hmg-common/ui/button/button.component.ts

79 lines
1.7 KiB
TypeScript

import { Component, OnInit, Input, Output, EventEmitter, Directive, ElementRef, HostListener } from '@angular/core';
import { ButtonSettings } from './models/button-settingsl';
import { TranslatorService } from '../../services/translator/translator.service';
@Component({
selector: 'app-button',
templateUrl: './button.component.html',
styleUrls: ['./button.component.scss'],
})
export class ButtonComponent implements OnInit {
6 years ago
constructor() {
6 years ago
}
ngOnInit() {
}
/*
@Input() icon: string;
@Input() title: string;
@Output() trigger = new EventEmitter();
@Input() settings: ButtonSettings;
public direction: string;
public style: any;
@Input() disabled = false;
constructor(
public ts: TranslatorService
) {
}
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
if (this.settings) {
this.style =
{
'border-top-left-radius': this.isEnabled(this.settings.topLeft),
'border-top-right-radius': this.isEnabled(this.settings.topRight),
'border-bottom-right-radius': this.isEnabled(this.settings.bottomRight),
'border-bottom-left-radius': this.isEnabled(this.settings.bottomLeft)
};
}
6 years ago
}
private isEnabled(enabled: boolean): string {
return enabled ? '30px' : '0px';
}
public onClicked() {
if (!this.disabled) {
this.trigger.emit();
}
}
}
@Directive({ selector: '[modal]' })
export class Modal implements OnInit {
constructor(private elRef: ElementRef) { }
ngOnInit() {
console.log(' on initialization');
}
ngOnDestroy() {
}
onMouseEnter() {
}
@HostListener('click', ['$event'])
onClick(event: any) {
alert('click');
}
6 years ago
*/
}