src/app/shared/components/tag-input/tag-input-item/tag-input-item.component.ts
selector | crm-tag-input-item |
styleUrls | tag-input-item.component.scss |
templateUrl | ./tag-input-item.component.html |
Methods |
Inputs |
Outputs |
constructor()
|
index
|
Type: |
readonly
|
Type:
Default value: |
selected
|
Type: |
text
|
Type: |
tagRemoved
|
$event type: EventEmitter<number>
|
removeTag |
removeTag()
|
Returns :
void
|
import {Component, Input, Output, EventEmitter} from "@angular/core";
@Component({
selector: 'crm-tag-input-item',
templateUrl: './tag-input-item.component.html',
styleUrls: ['./tag-input-item.component.scss']
})
export class TagInputItemComponent {
@Input() selected: boolean;
@Input() text: string;
@Input() index: number;
@Input() readonly: boolean = false;
@Output() tagRemoved: EventEmitter<number> = new EventEmitter();
constructor() { }
removeTag() {
this.tagRemoved.emit(this.index);
}
}
{{text}}
<span class="close" (click)="removeTag()" *ngIf="!readonly"> ×</span>