We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to bind a selected item in a drop-down list to a text box and edit it?

You can bind a selected value from the drop-down list using the ngModel and edit it inside the text box or numeric input box. The selected item text and value can be got using the change event of the drop-down list through the args.itemData. To bind this itemData text to the text box and edit the selected text, refer to the following code.

App.component.html:

 

App.component.ts:

 

 

App.module.ts:

 

import { NgModule } from '@angular/core';

import { BrowserModule } from '@angular/platform-browser';

import { FormsModule } from '@angular/forms';

import { DropDownListModule} from '@syncfusion/ej2-ng-dropdowns';

import { AppComponent } from './app.component';

import { HelloComponent } from './hello.component';

 

@NgModule({

    imports:      [ BrowserModule, FormsModule ,DropDownListModule],

    declarations: [ AppComponent, HelloComponent ],

    bootstrap:    [ AppComponent ]

})

export class AppModule { }

 

StackBlitz sample link: https://stackblitz.com/edit/angular-svhivj

Output:

Article ID: Published Date: Last Revised Date: Platform: Control:
8785 05/30/2018 05/30/2018 JavaScript - EJ 2 DropDownList
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.