By default JS script generated by dart2js has global name $ same as JQuery so it can be problematic to use both simultaneously. To solve this problem dart2js has parameter --global-js-name=={GLOBAL NAME} but {GLOBAL NAME} must match \$[a-z]* (example: $dart). In the Sublime Text - Build Systems, $ must be escaped with '\\'

Working parameter example:

"--global-js-name=\\$dart"

Resulting JS will start with something like:

// Generated by dart2js, the Dart to JavaScript compiler.
(function($dart){var A={}
delete A.x
var B={}
delete B.x
var C={}
有帮助吗?

解决方案

I posted this "Answer Question" for those who might have same problem. It took me reasonably long time to figure out.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top