A quick start Angular project that shows how to add new items to the Angular Dropdown List of Syncfusion by specifying an index and without an index. This project also includes a code snippet to reset a selected item programmatically in the Dropdown List component, and how to remove items from it.
Example:
https://ej2.syncfusion.com/angular/demos/#/material/drop-down-list/default
Documentation:
https://ej2.syncfusion.com/angular/documentation/drop-down-list/how-to/add-item/
https://ej2.syncfusion.com/angular/documentation/drop-down-list/how-to/clear-item/
https://ej2.syncfusion.com/angular/documentation/drop-down-list/how-to/remove-item/
Make sure that you have the compatible versions of TypeScript and Angular in your machine before starting to work on this project.
Angular 4+
TypeScript 2.6+
To run this application, you need to first clone the add-and-remove-items-dynamically-in-angular-dropdown-list repository and then navigate to its appropriate path where it has been in your system.
To do so, open the command prompt and run the below commands one after the other.
git clone https://github.com/subaa1492/add-and-remove-items-dynamically-in-angular-dropdown-list dropdownlist-example
cd dropdownlist-example
Once done with downloading, next you need to install the necessary packages required to run this application locally. The npm install command will install all the needed angular packages into your current project and to do so, run the below command.
npm install
Run ng serve command for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.