Trait OnAttribute

pub trait OnAttribute<E, F> {
    type Output;

    // Required method
    fn on(self, event: E, cb: F) -> Self::Output;
}
Expand description

Adds an event listener to an element definition.

Required Associated Types§

type Output

The type of the element with the event listener added.

Required Methods§

fn on(self, event: E, cb: F) -> Self::Output

Adds an event listener to an element.

Implementors§

§

impl<El, At, Ch, E, F> OnAttribute<E, F> for HtmlElement<El, At, Ch>
where El: ElementType + Send, At: Attribute + Send, Ch: RenderHtml + Send, E: EventDescriptor + Send + 'static, <E as EventDescriptor>::EventType: 'static + From<JsValue>, F: FnMut(<E as EventDescriptor>::EventType) + 'static,

§

type Output = <HtmlElement<El, At, Ch> as AddAnyAttr>::Output<On<E, F>>