pub fn bind_value(&self, sub: Signal<String>) -> &Self {
        let sub_handle = create_memo(cloned!((sub) => move || {
            Some((*sub.get()).clone())
        }));

        self.dyn_prop("value", sub_handle);

        self.on("input", move |e| {
            let value = Reflect::get(
                &e.target()
                    .expect("Target missing on input event.")
                    .unchecked_into::<web_sys::Element>(),
                &"value".into(),
            )
            .expect("Missing value prop.")
            .as_string()
            .expect("Value should be a string.");

            sub.set(value);
        })
    }
/// Binds `sub` to the `value` property of the node.
///
/// `sub` will be automatically updated when the value is updated.
///
/// # Example
/// ```
/// # use sycamore::prelude::*;
/// # use sycamore::builder::html::*;
/// # fn _test<G: Html>() -> View<G> {
/// let value = Signal::new(String::new());
///
/// input()
///     .bind_value(value)
///     .build()
/// # }
/// ```
Binds `sub` to the `value` property of the node.
`sub` will be automatically updated when the value is updated.
Binds ` sub ` to the ` value ` property of the node . ` sub ` will be automatically updated when the value is updated .
pub fn bind_value(&self, sub: Signal<String>) -> &Self {
        let sub_handle = create_memo(cloned!((sub) => move || {
            Some((*sub.get()).clone())
        }));
        self.dyn_prop("value", sub_handle);
        self.on("input", move |e| {
            let value = Reflect::get(
                &e.target()
                    .expect("Target missing on input event.")
                    .unchecked_into::<web_sys::Element>(),
                &"value".into(),
            )
            .expect("Missing value prop.")
            .as_string()
            .expect("Value should be a string.");
            sub.set(value);
        })
    }
pub fn bind_value ( & self , sub : Signal < String > ) -> & Self { let sub_handle = create_memo ( cloned ! ( ( sub ) move { Some ( ( sub get ( ) ) clone ( ) ) } ) ) ; self . dyn_prop ( " " , sub_handle ) ; self . on ( " " , move | e | { let value = Reflect :: get ( & e . target ( ) . expect ( " " ) . unchecked_into :: < web_sys :: Element > ( ) , & " " . into ( ) , ) . expect ( " " ) . as_string ( ) . expect ( " " ) ; sub . set ( value ) ; } ) }
Binds `sub` to the `value` property of the node.
Binds ` sub ` to the ` value ` property of the node .
&self
sub
Signal<String>
example
None
use sycamore::prelude::*;
None
use sycamore::builder::html::*;
None
fn _test<g: html>() -> view<g> {
let value = Signal::new(String::new()).

input()
.bind_value(value)
.build()
let value = Signal :: new ( String :: new () ) . input () . bind_value ( value ) . build ()
}
None