Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 385e613

Browse files
committed
add documents for cordova
1 parent 4718e08 commit 385e613

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

NON-STANDARD-APIS.md

+18
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,24 @@ remove the comment of the following line
6767
//import './extra/bluebird.spec';
6868
```
6969

70+
## Others
71+
72+
* Cordova
73+
74+
patch `cordova.exec` API
75+
76+
`cordova.exec(success, error, service, action, args);`
77+
78+
`success` and `error` will be patched with `Zone.wrap`.
79+
80+
to load the patch, you should load in the following order.
81+
82+
```
83+
<script src="zone.js"></script>
84+
<script src="cordova.js"></script>
85+
<script src="zone-patch-cordova.js"></script>
86+
```
87+
7088
## Usage
7189

7290
By default, those APIs' support will not be loaded in zone.js or zone-node.js,

gulpfile.js

+10
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ gulp.task('build/webapis-shadydom.min.js', ['compile-esm'], function(cb) {
123123
return generateScript('./lib/browser/shadydom.ts', 'webapis-shadydom.min.js', true, cb);
124124
});
125125

126+
gulp.task('build/zone-patch-cordova.js', ['compile-esm'], function(cb) {
127+
return generateScript('./lib/extra/cordova.ts', 'zone-patch-cordova.js', false, cb);
128+
});
129+
130+
gulp.task('build/zone-patch-cordova.min.js', ['compile-esm'], function(cb) {
131+
return generateScript('./lib/extra/cordova.ts', 'zone-patch-cordova.min.js', true, cb);
132+
});
133+
126134
gulp.task('build/bluebird.js', ['compile-esm'], function(cb) {
127135
return generateScript('./lib/extra/bluebird.ts', 'zone-bluebird.js', false, cb);
128136
});
@@ -204,6 +212,8 @@ gulp.task('build', [
204212
'build/webapis-notification.min.js',
205213
'build/webapis-shadydom.js',
206214
'build/webapis-shadydom.min.js',
215+
'build/zone-patch-cordova.js',
216+
'build/zone-patch-cordova.min.js',
207217
'build/zone-mix.js',
208218
'build/bluebird.js',
209219
'build/bluebird.min.js',

test/node_entry_point.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// Must be loaded before zone loads, so that zone can detect WTF.
1010
import './wtf_mock';
11-
import './custom_error';
11+
import './test_fake_polyfill';
1212

1313
// Setup tests for Zone without microtask support
1414
import '../lib/zone';

0 commit comments

Comments
 (0)