ergonlabs / liquid_dart Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
Any chance to enhance the tags to accept objects in the context?
Something like (similar to your introductionary example):
class User {
final String name;
final String email;
final List<String> roles;
// constructor
}
List<User> users = List();
// add some users
context.variables['users'] = users;
final template = Template.parse(context, Source.fromString(raw));
print(template.render(context));
This would greatly simplify my code.
For example, I have HTML:
<button onclick="{{doSomething}}">Click Me!</button>
and Dart code:
void main(){
//main function
}
doSomething(){
//Do something
}
How am I supposed to achieve this effect?
contains for condition in if not working
eg;
{% if string contains 'hello' %}
'bye'
{%else%}
'hello'
{% endif %}
expected o/p : bye
current o/p : hello
Hi,
the plus Filter does not seem to work:
{% assign we = 33 |plus: 22 %}
Error
E/flutter (25024): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Parse Exception: Unexpected Token: <TokenType.identifier line=1 column=19 value='plus'> expected null
Regards,
Sebastian
I wanted to implement the regroup
tag in my project since it is missing in the builtin tags. Unfortunately I am not able to create tags in my project because a couple of classes are not exposed. These are: Expression
, Tag
, Token
, TagParser
, TokenType
, Parser
, ParseException
.
There may be other necessary classes but for my first try that's it. Please make them available.
Regards,
Mike
The package currently depends on dart:io
, which prevents it from running on the web. Please remove this dependency or make it optional.
Hi,
I get an error when variables are assigned in a loop. This works with other liquid engines, is it possible to fix that?
Minimum example which causes the error:
{% for row in test %} {% assign a = 34 %} {% endfor %}
Error
E/flutter (25024): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Parse Exception: Unexpected Token: <TokenType.identifier line=10 column=7 value='endfor'> expected null
Thanks,
Sebastian
I was trying to get list length by doing
<b>Total Users {{ users | length }}</b>
and also by doing
<b>Total Users {{ users.length }}</b>
but none of them worked!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.