@pepperi/components
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.1.
44 lines (37 loc) • 1.37 kB
text/typescript
import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
import { SessionService } from '@pepperi/lib';
({
// tslint:disable-next-line: component-selector
selector: 'pepperi-textbox-icon',
templateUrl: './textbox-icon.component.html',
styleUrls: ['./textbox-icon.component.scss'],
})
export class PepperiTextboxIconComponent implements OnInit {
() value: string;
() label: string;
() type?: string;
() disabled: boolean;
test: boolean = true;
() iconClicked: EventEmitter<void> = new EventEmitter<void>();
constructor(public sessionService: SessionService) { }
ngOnInit() { }
iconButtonClicked() {
const currentValue = this.value;
if (currentValue.toString().trim().length > 0) {
switch (this.type) {
case 'email':
window.open('mailto:' + currentValue, 'email');
break;
case 'phone':
window.open('tel:' + currentValue, 'tel');
break;
case 'link':
window.open(currentValue);
break;
default:
break;
}
}
this.iconClicked.emit();
}
}