Skip to content

Conversation

@victor-valencia
Copy link

Please accepts my pull request to added iconField.

Fixed for issue: #215

img

export class ListItem {
id: String | number;
text: String | number;
icon: String;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need to be an optional parameter as not everyone would use an icon.

<li *ngFor="let item of _data | multiSelectFilter:filter; let i = index;" (click)="onItemClick($event,item)" class="multiselect-item-checkbox">
<input type="checkbox" aria-label="multiselect-item" [checked]="isSelected(item)" [disabled]="disabled || (isLimitSelectionReached() && !isSelected(item)) || item.isDisabled" />
<div>{{item.text}}</div>
<div><i class="{{item.icon}}"></i> {{item.text}}</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything related to icons would need to be tested first. You have modified the code as if 100% of users would consume this property. It would be an optional property.
<i *ngIf="item?.icon" class="{{item.icon}}">

];
this.selectedItems = [
{ item_id: 4, item_text: 'Pune', item_icon: 'fa fa-truck' },
{ item_id: 6, item_text: 'Navsari', item_icon: 'fa fa-wifi' }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing code should be unbothered. This would need to be refactored to not touch existing code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants