/** @file
 * @author Edouard DUPIN
 * @copyright 2018, Edouard DUPIN, all right reserved
 * @license PROPRIETARY (see license file)
 */
import { Component, OnInit } from '@angular/core';
import { PopInService } from '@kangaroo-and-rabbit/kar-cw';

@Component({
	selector: 'create-type',
	templateUrl: './create-type.html',
	styleUrls: ['./create-type.less']
})
export class PopInCreateType implements OnInit {
	name: string = '';
	description: string = '';

	constructor(private popInService: PopInService) {

	}
	OnDestroy() {

	}
	ngOnInit() {

	}
	eventPopUp(event: string): void {
		console.log(`GET event: ${event}`);
		this.popInService.close('popin-create-type');
	}
	updateNeedSend(): void {

	}
	onName(value: any): void {
		if (value.length === 0) {
			this.name = '';
		} else {
			this.name = value;
		}
		this.updateNeedSend();
	}

	onDescription(value: any): void {
		if (value.length === 0) {
			this.description = '';
		} else {
			this.description = value;
		}
		this.updateNeedSend();
	}
}
