ykmnkmi / jinja.dart

Jinja2 template engine port for Dart.
https://pub.dev/packages/jinja
MIT License
52 stars 11 forks source link

Accessing list element #3

Closed sainthasras closed 4 years ago

sainthasras commented 4 years ago

Hello Jinja team, can you please show us how to access individual elements in a list? I sent a list (myList:[1,2,3,4,5]) from my controller and will like to access element like {{ myList[0] }} in the html page. Nothing shows up. But when you call {{ myList }}, the list is nicely displayed.

Thanks.

ykmnkmi commented 4 years ago

Hello, fixed 0.2.2.

sainthasras commented 4 years ago

Yes. Fixed. Thank you. Great work. We can't wait for your official documentation....

chocovish commented 4 years ago

accessing via index number is working fine but if the index contains another map then we can't just access those map values with {{ names[1].location }}. though {{ names[1]['location'] }} works!

ykmnkmi commented 4 years ago

Fixed 0.2.3