You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The length in handlerbars-rust syntax is not supported
example:
use handlebars::Handlebars;#[macro_use]externcrate serde_json;fnmain(){letmut h = Handlebars::new();
h.register_template_string("1",r#" {{foo.length}} "#).unwrap();let res = h.render("1",&json!({"foo":["1","2"]})).unwrap();println!("{}",res);}
Compile and run the application, and you can get the response:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: RenderError { desc: "Error on accessing array/vector with string index.: invalid digit found in string", template_name: Some("1"), line_no: Some(2), column_no: Some(5), cause: Some(ParseIntError { kind: InvalidDigit }) }', src/main.rs:10:57
{{#each list}}
{{/each}}
how to get list's length ?
the follow code is wrong
{{#if (gte list.len() 0)}}
{{/if}}
The text was updated successfully, but these errors were encountered: