Enforcing validation is essential to a great UX. It supports the following: - Disabled attribute - In case you are passing the data through markup: - Disabled property - In case you are using the data option: myData = [ ... { text: 'Chicago', value: 'chi', disabled: true }]
Having invalids set up correctly not just enhances the UX, but improves performance.
Demo
html<mbsc-select
[data]="myData"
[ touchUi] =" ">
</mbsc-select>
tsmyData = [
{ text: 'Atlanta', value: 'atl' },
{ text: 'Berlin', value: 'ber' },
{ text: 'Boston', value: 'bos' },
{ text: 'Chicago', value: 'chi', disabled: true },
{ text: 'London', value: 'lon', disabled: true },
{ text: 'Los Angeles', value: 'la' },
{ text: 'New York', value: 'ny' },
{ text: 'Paris', value: 'par' },
{ text: 'San Francisco', value: 'sf' }
];
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { MbscModule, setOptions } from '@mobiscroll/angular';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
standalone: true,
imports: [CommonModule, MbscModule],
})
export class AppComponent {
myData = [
{
text: 'Atlanta',
value: 'atl',
},
{
text: 'Berlin',
value: 'ber',
},
{
text: 'Boston',
value: 'bos',
},
{
text: 'Chicago',
value: 'chi',
disabled: true,
},
{
text: 'London',
value: 'lon',
disabled: true,
},
{
text: 'Los Angeles',
value: 'la',
},
{
text: 'New York',
value: 'ny',
},
{
text: 'Paris',
value: 'par',
},
{
text: 'San Francisco',
value: 'sf',
},
];
}