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

feat(jsonp): provide a help method to patch jsonp #997

Merged
merged 1 commit into from
Feb 10, 2018

Conversation

JiaLiPassion
Copy link
Collaborator

@JiaLiPassion JiaLiPassion commented Jan 25, 2018

fix angular/angular#7792
provide a helper method to patch jsonp.

Because jsonp has a lot of implementation, so
user need to provide the information to let json send and callback in zone.

sample usage is:

import 'zone.js/dist/zone-patch-jsonp';
Zone['__zone_symbol__jsonp']({
  jsonp: getJSONP,
  sendFuncName: 'send',
 onSuccessFuncName: 'onSuccess',
 onFailedFuncName: 'onFailed'
});

update

now the CI failed because new version jasmine complains, I have pinned the version of jasmine in #994.

@valera-rozuvan
Copy link

valera-rozuvan commented Jan 25, 2018

Demo repository of Zone.js & JSONP: https://github.com/valera-rozuvan/test-zone-js-with-jsonp . Currently Zone.js doesn't work with JSONP. @robdodson can you please get someone to look at this PR? @mhevery any thoughts? Angular will benefit from this PR. Now you have to do custom Change Detection inside angular component if JSONP functionality is used by some 3rd party lib...

@valera-rozuvan
Copy link

https://github.com/angular/zone.js/issues/44 also is in this category.

@JiaLiPassion JiaLiPassion changed the title feat(jsonp): provide a help method to patch jsonp WIP(jsonp): provide a help method to patch jsonp Feb 7, 2018
@JiaLiPassion
Copy link
Collaborator Author

Change to WIP to make the success callback factory more flexible. I will update this PR later today.

@JiaLiPassion JiaLiPassion changed the title WIP(jsonp): provide a help method to patch jsonp feat(jsonp): provide a help method to patch jsonp Feb 9, 2018
@mhevery mhevery merged commit 008fd43 into angular:master Feb 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change detection not being triggered in third party Ajax callbacks
4 participants