Skip to content

Instantly share code, notes, and snippets.

@AlexMocioi
Created April 22, 2014 20:24
Show Gist options
  • Save AlexMocioi/11193038 to your computer and use it in GitHub Desktop.
Save AlexMocioi/11193038 to your computer and use it in GitHub Desktop.
Add callback function in dart to jquery UI component
class CallbackFunction implements Function {
final Function f;
CallbackFunction(this.f);
call() => throw new StateError('There should always been at least 1 parameter'
'(js this).');
noSuchMethod(Invocation invocation) {
Function.apply(f, []);
}
}
.callMethod("spinner", [new js.JsObject.jsify({
"stop": new js.JsFunction.withThis(new CallbackFunction(recalc),
"page": 1,
"step": 0.1
})])
void recalc(){
print("recalcing");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment