Is there a way to bind functions with attributes, something like this:
<a _href="{{go('login')}}">Login</a>
then
String go(String routePath) {
// Returns url for login
}
For routing task, you may bind using additional attribute for path:
<a route="/api/login" on-tap="{{go}}">
and then, in your go function:
void go(Event e, var detail, Element sender) {
e.preventDefault();
fire('change-route', detail: sender.attributes['route'] );
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With