OLD | NEW |
---|---|
1 Methods and annotations to specify interoperability with JavaScript APIs. | 1 Methods and annotations to specify interoperability with JavaScript APIs. |
2 | 2 |
3 *Note: This package is beta software.* | 3 *Note: This package is beta software.* |
4 | 4 |
5 *Note: This packages requires Dart SDK `>=1.13.0-dev.7`.* | 5 *Note: This packages requires Dart SDK `>=1.13.0-dev.7`.* |
6 | 6 |
7 ### Adding the dependency | 7 ### Adding the dependency |
8 | 8 |
9 Add the following to your `pubspec.yaml`: | 9 Add the following to your `pubspec.yaml`: |
10 | 10 |
11 ```yaml | 11 ```yaml |
12 dependencies: | 12 dependencies: |
13 js: ^0.6.0-beta | 13 js: ^0.6.0-beta |
14 ``` | 14 ``` |
15 | 15 |
16 #### Passing functions to JavaScript. | 16 #### Passing functions to JavaScript. |
17 | 17 |
18 If you are passing a Dart function to a JavaScript API, you must wrap it using | 18 If you are passing a Dart function to a JavaScript API, you must wrap it using |
19 `allowInterop` or `allowInteropCaptureThis`. | 19 `allowInterop` or `allowInteropCaptureThis`. |
20 | 20 |
21 ### Examples | 21 ### Examples |
22 | 22 |
23 There is a [full example](https://github.com/dart-lang/sdk/tree/master/pkg/js/ex ample) hosted with the `package:js` source code. | 23 See the [Chart.js Dart API](https://github.com/google/chartjs.dart/) for a usage example. |
Jacob
2015/11/17 19:04:50
nit: for a usage example --> for an end to end exa
kevmoo
2015/11/17 19:10:00
Done.
| |
24 | 24 |
25 #### Calling methods | 25 #### Calling methods |
26 | 26 |
27 ```dart | 27 ```dart |
28 // Calls invoke JavaScript `JSON.stringify(obj)`. | 28 // Calls invoke JavaScript `JSON.stringify(obj)`. |
29 @JS("JSON.stringify") | 29 @JS("JSON.stringify") |
30 external String stringify(obj); | 30 external String stringify(obj); |
31 ``` | 31 ``` |
32 | 32 |
33 #### Classes and Namespaces | 33 #### Classes and Namespaces |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 ## Contributing and Filing Bugs | 93 ## Contributing and Filing Bugs |
94 | 94 |
95 Please file bugs and features requests on the [Github issue tracker](https://git hub.com/dart-lang/sdk/issues). | 95 Please file bugs and features requests on the [Github issue tracker](https://git hub.com/dart-lang/sdk/issues). |
96 | 96 |
97 We also love and accept community contributions, from API suggestions to pull re quests. | 97 We also love and accept community contributions, from API suggestions to pull re quests. |
98 Please file an issue before beginning work so we can discuss the design and impl ementation. | 98 Please file an issue before beginning work so we can discuss the design and impl ementation. |
99 We are trying to create issues for all current and future work, so if something there intrigues you (or you need it!) join in on the discussion. | 99 We are trying to create issues for all current and future work, so if something there intrigues you (or you need it!) join in on the discussion. |
100 | 100 |
101 Code contributors must sign the | 101 Code contributors must sign the |
102 [Google Individual Contributor License Agreement](https://developers.google.com/ open-source/cla/individual?csw=1). | 102 [Google Individual Contributor License Agreement](https://developers.google.com/ open-source/cla/individual?csw=1). |
OLD | NEW |