import { Component, input, OnInit } from '@angular/core';
import { IonInput, IonButton, IonChip } from '@ionic/angular/standalone';
@Component({
  selector: 'edit-tag',
  templateUrl: './edit-tag.component.html',
  styleUrls: ['./edit-tag.component.scss'],
  standalone: true,
  imports: [IonInput, IonButton, IonChip],
})
export class EditTagComponent implements OnInit {

  user_tag: Array<string> = []
  textResult: string = ""
  userInput(ev: any) {
    console.log(ev)
    this.textResult = ev.detail.value
  }
  Add_tags() {
    this.user_tag.push(this.textResult)
    this.textResult = ""
  }
  Delete_tag(tag: string) {
    let idx = this.user_tag.findIndex(item => item == this.textResult)
    this.user_tag.splice(idx, 1)
  }
  constructor() { }

  ngOnInit() { }

}
