Dart js-interop packages provides access to the Javascript objects.

learn more… | top users | synonyms

0
votes
0answers
10 views

Automate JavaScript Interop in Dart

When using a third-party JavaScript library in my Dart project, I manually go through the library's documentation and iterate through its properties and methods to build the Dart code through a series ...
1
vote
1answer
24 views

Dart js-interop not working if .dart file isn't included

After announcing new strategy for Dart, i decided to change include from <script type="application/dart" src="/dart/script.dart"></script> to <script type="text/javascript" ...
1
vote
1answer
31 views

Angular.Dart javascript interop error

I have problem with my code which is using 3rd party library. When I use it in the plain Dart itself it already works, but not with Angular.Dart. I have used chapter3 from Dart tutorial and just added ...
4
votes
1answer
68 views

Calling anonymous Javascript function from Dart Code

I'm writing a Dart library that is being called from JavaScript and on completion, Dart needs to call an anonymous callback function that is sitting inside JavaScript. JavaScript: function main() { ...
1
vote
1answer
53 views

Dart events in JavaScript

I have this code here, which I am converting to Dart. The problem is with the callbacks. function stop(e) { var node = e.target.getContainer(); node[SMap.LAYER_MARKER].style.cursor = ""; ...
1
vote
1answer
58 views

Dart using jQuery date picker with initial parameters

This works: js.context.callMethod(r'$', ['.datepicker']).callMethod('datepicker', []); as in it shows a box with a calendar in it in the default form of mm/dd/yyyy but this doesn't change the ...
2
votes
3answers
99 views

How to create an object from a function

I am trying to create a wrapper for lunr.js (http://lunrjs.com/) in Dart, however, I can find no documentation on how to use this with the Dart js interop. This is the object I am trying to create: ...
2
votes
2answers
58 views

For dartjs what is the odd list of alphabet ( A to Z ) empty class instances for?

At the top of every dart file's compiled javascript is this odd list. function dart() { this.x = 0; delete this.x; } var A = new dart; var B = new dart; var C = new dart; var D = new dart; var E ...
0
votes
1answer
60 views

Using Skrollr with Dart

I'm trying to implement some scroll based animation in my Dart web application using Skrollr.js. So far I have the following in main(): main() { ScriptElement script = new ScriptElement() ...
2
votes
2answers
91 views

Exporting Dart APIs to JavaScript, without a Dart VM

I'd like to export a Dart API to JavaScript on browsers without a Dart VM. For example, given a class A: class A { String name; A(); A.withName(this.name); } I'd like to create a JavaScript ...
0
votes
1answer
54 views

Using Dart classes from JavaScript

I have a Dart class (foo.dart): class Foo { void talk() { print('Hello'); } } After compiling foo.dart to JavaScript, I'd like to be able to use Foo like this: var foo = new Foo(); // from ...
1
vote
1answer
48 views

Anonymous callback function to JsObject doesn't update Dart Controller until after a user action

Given the dart code class LandingController { bool hideDiv = false; void doit() { new JsObject(context['loginControls']).callMethod('fadeLogin', [() { print(hideDiv); ...
0
votes
1answer
82 views

dart client side hide/obfuscate code

Is it possible to hide/obfuscate the client side dart code (or js generated by dart)? It looks like obfuscation is the route to when using javascript. Does dart come with an obfuscator? thanks
2
votes
1answer
136 views

How to use javascript from Dart inside a polymer element

I am trying to modify sample-google-maps to work inside a polymer element. On running following code I don't see anything except the title and there are no errors.Please advise how can I make this ...
0
votes
1answer
59 views

Is there a way to catch a JavaScript exception in Dart?

I have a <core-icon> element like <polymer-element name="app-element"> <template> <core-icon icon="{{icon}}"></core-icon> </template> <script ...
0
votes
2answers
153 views

using Blockly's addChangeListener() function from Dart (js interop)

I've been writing some wrapper code to access the Blockly API from Dart, using dart:js. All is going smoothly until I need to pass a function to one of Blockly's event registration functions on the ...
1
vote
1answer
71 views

struggle for javascript porting to dart

Original javascript code I like to port to Dart. hterm.defaultStorage = new lib.Storage.Chrome(chrome.storage.sync); I have tried js.context['hterm']['defaultStorage'] = new ...
1
vote
2answers
78 views

Call dart function in angular controller initialization

I try to call a dart function in an AngularJS controller initialization, but I get ReferenceError: myFunction is not defined. index.dart import 'dart:js'; myDartFunction() { return 42; } main() ...
0
votes
0answers
81 views

Can't access jQuery from context.callMethod

I'm trying to add the handsontable through the dart:js context object, but getting the error: Exception: Uncaught Error: NoSuchMethodError: method not found: 'jQuery' Receiver: Instance of 'JsObject' ...
3
votes
2answers
250 views

Dart chrome extension: Listen to chrome api events

To better describe my problem i have created a small example of a chrome extension written in Dart. You can see the code or download the extension on Gist. The problem This example is running fine ...
-1
votes
2answers
60 views

Google Dart Only Show Specific DropDown Child Elements

I'm attempting to get only certain values from a drop-down by hiding a select few. Apparently I cannot go over an array index of 3 or nothing shows up and obviously not below an index of 0. I'm ...
0
votes
1answer
143 views

Call google maps api event addListener using dart:js

In the Google Maps API v3 they have stated that we need to do this to open the infowindow when the marker gets clicked: google.maps.event.addListener(marker, 'click', function() { ...
2
votes
1answer
90 views

Event Jquery UI in dart

I'm trying to get Event object in listener function of a Jquery Ui Element. I'm actually programming in dart language and use the js package (dart:js) Here is an example : Example.html : <script ...
1
vote
1answer
59 views

What is the dart equivalent of getScript

What is the Dart equivalent of Jquery getScript (to load javascript from Dart) ? http://api.jquery.com/jquery.getscript Thanks for your suggestions.
3
votes
1answer
89 views

Issue with chrome.runtime.onConnect when building chrome extension in dart

I have the following problem when running dart2js compiled version of my chrome extension: Uncaught TypeError: undefined is not a function when executing ...
0
votes
1answer
62 views

How to remove a listener in chrome.webRequest API in dart?

Related to `chrome.webRequest.onBeforeRequest.removeListener`? -- How to stop a chrome web listener, I am trying to deregister a listener using dart:js After invoking ...
2
votes
0answers
78 views

how to unwrap underlying event object from event listener argument in dart

i have following dart code: @override void attached() { document.onCopy.listen(_onCopyHandler); } void _onCopyHandler(Event event) { // Here i'd like to access event.clipboardData but it // ...
4
votes
1answer
162 views

How to get “this” from a Callback in Dart:js

I am trying to integrate highcharts as an AngularDart component. The Js interop works like a charm, but I have come across a problem I cannot overcome. Highcharts lets the user provide callbacks to ...
3
votes
2answers
196 views

Using dart to create a javascript library

The problem I'm currently working on a JavaScript library, and in order to reduce the amount of bugs I thought that my library might benefit from using Dart's static typing mechanism. First, because ...
1
vote
2answers
106 views

Gmaps LatLng not found in MouseEvent using angular.dart

Am working in an angular.dart project that uses gmaps. And i want to get the LatLng value on map click. My map.html : <div id="map" ng-click="ctrl.mapClick($event)"></div> My DartCtrl ...
0
votes
0answers
118 views

Handsontable in an AngularDart component?

I'm trying to get a Handsontable to work within a AngularDart component. If I put it in the main html page of the AngularDart application it works OK, but if I put it in a AngularDart component I get ...
3
votes
1answer
168 views

How to use this javascript library in Dart?

The problem I tried to use the JS code below in Dart with "new JsObject(context["Delaunay"])", however, I get a message that: Exception: type JsObject is not a subtype of type JsFunction of ...
1
vote
1answer
258 views

Convert JS object into Dart classes

What is the best pattern to use to convert objects from Javascript to their Dart class counter parts? // car.dart import 'part.dart'; class Car { String paintColor; List<Part> parts; } ...
1
vote
2answers
170 views

Using thirdparty libraries from dart language

How can import and use any third party javascript libraries in dart..? I want to use snapsvg in my dart application to render svg. But not sure how to add dependencies to add and import it. I added ...
2
votes
1answer
296 views

How do I create an anonymous JavaScript function/callback with Dart's JS interop?

I am using Dart and its JS interop. I need to convert the following JavaScript code to Dart: ID3.loadTags("filename.mp3", function() { var tags = ID3.getAllTags("filename.mp3"); if (tags.artist) ...
0
votes
1answer
86 views

import js file in ngComponent html template

I have a component which interact with JS library : @NgComponent( selector: 'mapcomp', templateUrl: 'packages/org_rtosm_update/map/map.html', cssUrl: ...
1
vote
2answers
143 views

When calling dart complied Javascript from javascript how do I pass in a callback function into dart compiled Javascript?

I'm trying to convert my project to dart step by step. I have converted a stand alone library to Dart and I'm using the Dart compiled javascript in my project. Thanks for the help in my other ...
1
vote
1answer
102 views

js-interop: Passing javascript object from dart

I'm struggling to port javascript to dart.. My problem is how to create javascript object. original javascript code is function Beagle() { this.argv_ = null; this.io = null; }; ...
1
vote
1answer
63 views

js-interop: how to implement javascript `new` to dart with js-interop?

javascript code is.. var terminal = new hterm.Terminal('nike'); I tried to use js-interop var obj = js.context['hterm']['Terminal']; var terminal = obj('nike'); but the result is wrong. how ...
1
vote
1answer
173 views

Dart onYouTubeIframeAPIReady

How can i create function onYouTubeIframeAPIReady from this example https://developers.google.com/youtube/iframe_api_reference#Getting_Started in Dart? The API will call this function when the page ...
2
votes
1answer
154 views

How to call a dart method from Javascript after dart2js

I got this Dart Script below and I want to access the methods from the class hello_world by JavaScript after I compiled the Dart Script with dart2js. Does anybody know how this works?! I already know ...
1
vote
1answer
347 views

JS to Dart Conversion

This is a 2 part question. I am not lazy, simply not fundamentally fluent enough in JS to convert an entire library while referencing the Dart Synonyms page it seems. The Dart:js documentation ...
1
vote
1answer
282 views

jQueryUI and jQueryUI-touch-punch don't work with Polymer.dart

I'm developing a small Dart app using jQueryUI and jQueryUI-touch-punch with Polymer.dart. When I don't use Polymer.dart, everything works well. But with Polymer.dart, several problems occurred. Here ...
2
votes
1answer
173 views

Is it possible to define valid JavaScript's functions from Dart?

Sorry for my broken English. I'm new to the Dart language. I have been searching for a way to communicate between JS and Dart. I want to call jQueryUI code from Dart. When I create a jQueryUI's ...
1
vote
1answer
158 views

Difference between Dartium and dart2js when building chrome extensions

I have the following problem when running dart2js compiled version of my chrome extension: Uncaught TypeError: Object #<JsObject> has no method 'where$1' I have created a minimal example: ...
0
votes
2answers
241 views

how to use javascript ui libraries with dart

Dart widget is really poor when we compare will all the widget of jquery-ui and it's plugin. I don't found widget similar to jqgrid. Except waiting then dart have a lot of widget, is there a way to ...
1
vote
1answer
138 views

How to bind JavaScript callback in stable 1.1.1 Dart and bind Dart callback in JavaScript (Dart2Js2Dart)?

I want to write some Dart function "oKey" which calls JavaScript function "jsOnKey" (with success or exception too since cannot predict). Next I want that JavaScript function "onKey" will call Dart ...
2
votes
1answer
113 views

Dart google_maps issue

i have a weird behavior of Google maps using dart !! here as you see the link responsible for making th map appears is "Géolocalisation" until now i have no problem! but when i reclick, or when i ...
1
vote
1answer
202 views

JS Object.create() in Dart

I'm constructing two JS object in Dart. In JS, they are constructed with Object.create(): var wavesurfer1 = Object.create(WaveSurfer); var wavesurfer2 = Object.create(WaveSurfer); This is what I ...
0
votes
1answer
82 views

How do I call a function on an element using dart?

I'm new to dart, and I'm trying to realize how to implement the following javascript code in dart: $('element1').handsontable(options); handsontable is a third party library that I want to use.