We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1ce8866 + 9240d78 commit 1436dc2Copy full SHA for 1436dc2
projects/multiselect/src/lib/pipes/display-selected-value.pipe.ts
@@ -10,11 +10,13 @@ export class DisplaySelectedValuePipe implements PipeTransform {
10
defaultMaxLabelCount: number = 3;
11
transform(value: any, maxLabelCount: number = this.defaultMaxLabelCount): any {
12
if (value instanceof Array) {
13
+
14
const collection = [...value];
15
+ var total = collection.length;
16
const condn = collection.length > maxLabelCount;
17
condn ? (collection.length = maxLabelCount) : null;
18
- return `${collection.map(v => v.name).join(', ')}${condn ? DOTS : ''}`;
19
+ return `${collection.map(v => v.name).join(', ')}${condn ? DOTS + ' ('+total+')' : ''}`;
20
}
21
return value && value.name;
22
0 commit comments