Topic: MDB-Select - Cannot use ngFor
Dawid Adach pro answered 7 years ago
<div class="row"> <divclass="col-md-6"> <mdb-select [options]="dateOptionsSelect" [(ngModel)]="selectedCharacter"> placeholder="Choose your option"></mdb-select> <label>Example label</label> </div> </div>
dateOptionsSelect = [ { value: '1', label: 'Today', selected: true }, { value: '2', label: 'Yesterday' }, { value: '3', label: 'Last 7 days' }, { value: '4', label: 'Last 30 days' }, { value: '5', label: 'Last week' }, { value: '6', label: 'Last month' } ]; selectedCharacter = '1';
UoStA_ajdi pro commented 7 years ago
This solution only works with String value. Can we have the ability for it to work with number and boolean as well?UoStA_ajdi pro commented 7 years ago
Modified line 238 in select.component.ts to this else if (typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' ) it is now working as desired. but can this please be added to the next release so we do not lose the changes on update.Closed
This topic is closed.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Closed
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No