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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Events of Editor Controls

When a user interacts with your app, it's sometimes necessary to know when this happens. A click, hover, or a keyboard action are all events that you can use to call component logic within Angular.

That's what Angular event binding is all about. It's one-way data binding, in that it sends information from the view to the component class. This is opposite from property binding, where data is sent from the component class to the view.

Syncfusion Angular Components supports Event binding i.e ejclick, ejchange, select etc. Events can be bound to the controls using the event name within bracket ‘()’.

Here we triggered ejclick function of ejButton Component. Refer to the below code snippet for click event of button Component. To know more about specific events of Angular components, refer the link here

<button type="button" ej-button text="MyButton" (ejclick)="btnclick($event)"></button>

 

 

In model file, click event handler prints the button text in console. Using this click event handler, we can get the details of button component from ‘event.model’.

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

 

@Component({

    selector: 'ej-app',

    templateUrl: './button.component.html',

})

export class ButtonComponent {

    btnclick(event){

        console.log(event.model.text);

    }

}

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
8035 10/13/2017 10/13/2017 JavaScript General
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon 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.Close Icon