Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Jul 4, 2024
1 parent 4f7d691 commit f9974c0
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,14 @@ export class MultiSelectItem {
<div #token *ngFor="let item of chipSelectedItems(); let i = index" class="p-multiselect-token">
<span class="p-multiselect-token-label">{{ getLabelByValue(item) }}</span>
<ng-container *ngIf="!disabled">
<TimesCircleIcon *ngIf="!removeTokenIconTemplate" [ngClass]="{'p-disabled': item[this.optionDisabled]}" [styleClass]="'p-multiselect-token-icon'" (click)="removeOption(item, event)" [attr.data-pc-section]="'clearicon'" [attr.aria-hidden]="true" />
<TimesCircleIcon
*ngIf="!removeTokenIconTemplate"
[ngClass]="{ 'p-disabled': isOptionDisabled(item) }"
[styleClass]="'p-multiselect-token-icon'"
(click)="removeOption(item, event)"
[attr.data-pc-section]="'clearicon'"
[attr.aria-hidden]="true"
/>
<span *ngIf="removeTokenIconTemplate" class="p-multiselect-token-icon" (click)="removeOption(item, event)" [attr.data-pc-section]="'clearicon'" [attr.aria-hidden]="true">
<ng-container *ngTemplateOutlet="removeTokenIconTemplate"></ng-container>
</span>
Expand Down Expand Up @@ -1182,15 +1189,7 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
return ObjectUtils.isNotEmpty(this.maxSelectedLabels) && this.modelValue() && this.modelValue().length > this.maxSelectedLabels ? this.modelValue().slice(0, this.maxSelectedLabels) : this.modelValue();
});

constructor(
public el: ElementRef,
public renderer: Renderer2,
public cd: ChangeDetectorRef,
public zone: NgZone,
public filterService: FilterService,
public config: PrimeNGConfig,
public overlayService: OverlayService
) {
constructor(public el: ElementRef, public renderer: Renderer2, public cd: ChangeDetectorRef, public zone: NgZone, public filterService: FilterService, public config: PrimeNGConfig, public overlayService: OverlayService) {
effect(() => {
const modelValue = this.modelValue();

Expand Down

0 comments on commit f9974c0

Please sign in to comment.