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

feat(Jsonp): add support for JSONP #409

Closed
jeffbcross opened this issue May 13, 2016 · 3 comments
Closed

feat(Jsonp): add support for JSONP #409

jeffbcross opened this issue May 13, 2016 · 3 comments
Assignees

Comments

@jeffbcross
Copy link
Contributor

Create a binding for JSONP. Should behave similarly to the browser version, without the convenience of placing a <script> tag in the page.

@PatrickJS
Copy link
Contributor

PatrickJS commented May 13, 2016

for the jsonp we probably can use new Function wrapping Http#request

var jsonpResponse = 'callback({json: {}})';

var responseFactory = new Function('callback', 'return ' + jsonpResponse)

var responseJson = responseFactory(json => json)

or

var jsonpResponse = 'callback({json: {}})';

var responseFactory = new Function('', 'function callback(json) { return json } \n return ' + jsonpResponse)

var responseJson = responseFactory()

@PatrickJS
Copy link
Contributor

done via 4575cb0

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants