Topic: Multiple select weird comma
Damian Gemza staff answered 7 years ago
optionsSelect: Array<any>; ngOnInit() { this.optionsSelect= [ { value: '1', label: 'Option 1' }, { value: '2', label: 'Option 2' }, { value: '3', label: 'Option 3' }, { value: '4', label: 'Option 4' }, { value: '5', label: 'Option 5' }, { value: '6', label: 'Option 6' }, { value: '7', label: 'Option 7' }, { value: '8', label: 'Option 8' }, { value: '9', label: 'Option 9' }, ]; }
majnor pro answered 7 years ago
Start your code here<div class="multiple"> <!--bindings={"ng-reflect-ng-if": "false"}--> <!--bindings={"ng-reflect-ng-for-of": "[object Object],[object Object"}--> <div class="option"> <span class="deselect-option">, </span>Salmonella Pathogenicity Island SPI-1 </div> <div class="option"> <span class="deselect-option">, </span>Salmonella Pathogenicity Island SPI-2 </div> <!--bindings={"ng-reflect-ng-if": "false"}--> <!--bindings={"ng-reflect-ng-if": "true"}--><div class="toggle"> ... regards,
Damian Gemza staff answered 7 years ago
majnor pro commented 7 years ago
I knew it was the length of the options that were the cause. But if there is nothing to do about it now i would like to subbmit a change request, put the comma behind the option and the hide the las comma with css with the last option. From the docs: NgForOf provides several exported values that can be aliased to local variables: $implicit: T: The value of the individual items in the iterable (ngForOf). ngForOf: NgIterable: The value of the iterable expression. Useful when the expression is more complex then a property access, for example when using the async pipe (userStreams | async). index: number: The index of the current item in the iterable. first: boolean: True when the item is the first item in the iterable. last: boolean: True when the item is the last item in the iterable. even: boolean: True when the item has an even index in the iterable. odd: boolean: True when the item has an odd index in the iterable. regards,Damian Gemza staff commented 7 years ago
Thanks for your's report. We'll take a look at this, and we'll think how we can upgrade our Material Select in future. Best Regards, DamianFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No