Comments (9)
Hi,
Yes, I'll do this, I'm working round my packages again at the mo, just republished Wilt and I'm working on Sporran, Ill get back round to this as soon as.
from aloha.
Thanks for the update!
from aloha.
Hi,
Looking at the dart:js library I can't see any way to bind to js events, in my code at the moment i do this
' _alohaContext.bind('aloha-editable-deactivated', _jsEditableDeactivated);
This binds the aloha-editable-deactivated event to my handling callback in Dart, how would I do this with the dart:js package and/or using it with other supporting packages?
from aloha.
Here's one way that might work, though I haven't tested it:
_alohaContext.callMetho('on', ['aloha-editable-deactivated'], _jsEditableDeactivated);
Maybe @justinfagnani knows of a better way?
from aloha.
Not quite as above, but it does work -
jsnew.JsObject _alohaContextNew = jsnew.context['Aloha'];
_jsReady() {
_ready = true;
_onReady.add(null);
};
_alohaContextNew.callMethod('bind', ['aloha-ready',_jsReady]);
OK I think I'm good to go with the conversion, I'll update Aloha to use dart:js
from aloha.
yep, that looks right!
from aloha.
OK, job done, all converted to use dart:js.
This was well worthwhile, not only have we ended up using the way we are going with js interop I've learned a lot about dart:js on the way.
This was helped by the fact the debugger allows you now to see the js side of the js proxy (JsObject), when I did this originally either the way package:js worked or the the debugger worked didn't allow me to do this, either way its much better now.
from aloha.
@shamblett glad to hear it! If you have a time, a blog post of your experience would be a big help to the community. Or, if you like, you can update this doc with a pull request: https://github.com/dart-lang/www.dartlang.org/tree/master/src/site/articles/js-dart-interop
We can thank @jacob314 for the debugger improvements. :)
from aloha.
@shamblett did you notice any size or speed improvements?
from aloha.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aloha.