Loading README.md +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ The following optional configuration items can be used. | maxItems | | Limit the number of items shown in the pop-up menu. The default is no limit. | | mentionSelect | | An optional function to format the selected item before inserting the text. | | labelKey | label | The field to be used as the item label (when the items are objects). | | disableSort | false | Dsiable sorting of suggested items. | | disableSearch | false | Disable internal filtering (only useful if async search is used). | For Example: Loading src/mention/mention-config.ts +3 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,9 @@ export interface Mentions { // option to limit the number of items shown in the pop-up menu maxItems?:number; // option to disable sorting disableSort?:boolean; // optional function to format the selected item before inserting the text mentionSelect?:(item: any) => (string); } No newline at end of file src/mention/mention.directive.ts +3 −1 Original line number Diff line number Diff line Loading @@ -116,8 +116,10 @@ export class MentionDirective implements OnChanges { } // remove items without an labelKey (as it's required to filter the list) items = items.filter(e => e[config.labelKey]); if (!config.disableSort) { items.sort((a,b)=>a[config.labelKey].localeCompare(b[config.labelKey])); } } config.items = items; // add the config Loading Loading
README.md +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ The following optional configuration items can be used. | maxItems | | Limit the number of items shown in the pop-up menu. The default is no limit. | | mentionSelect | | An optional function to format the selected item before inserting the text. | | labelKey | label | The field to be used as the item label (when the items are objects). | | disableSort | false | Dsiable sorting of suggested items. | | disableSearch | false | Disable internal filtering (only useful if async search is used). | For Example: Loading
src/mention/mention-config.ts +3 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,9 @@ export interface Mentions { // option to limit the number of items shown in the pop-up menu maxItems?:number; // option to disable sorting disableSort?:boolean; // optional function to format the selected item before inserting the text mentionSelect?:(item: any) => (string); } No newline at end of file
src/mention/mention.directive.ts +3 −1 Original line number Diff line number Diff line Loading @@ -116,8 +116,10 @@ export class MentionDirective implements OnChanges { } // remove items without an labelKey (as it's required to filter the list) items = items.filter(e => e[config.labelKey]); if (!config.disableSort) { items.sort((a,b)=>a[config.labelKey].localeCompare(b[config.labelKey])); } } config.items = items; // add the config Loading