angular.dart
angular.dart copied to clipboard
JSONP is not implement in AngularDart
How so?
It was just never implemented into AngularDart. Try it out. Http treats it just like any other GET request.
It looks like it is still not working. I can try to implement it.
Sure, but the browsers which dart supports are CORS enabled, so is this even worth it?
On Sat, May 24, 2014 at 11:19 PM, Victor Savkin [email protected]:
It looks like it is still not working. I can try to implement it.
— Reply to this email directly or view it on GitHubhttps://github.com/angular/angular.dart/issues/467#issuecomment-44100033 .
I think the concern is for APIs that do not provide CORS headers, but instead only use callbacks.
Legacy services ?
On May 25, 2014 3:47:27 PM CEST, "Miško Hevery" [email protected] wrote:
Sure, but the browsers which dart supports are CORS enabled, so is this even worth it?
On Sat, May 24, 2014 at 11:19 PM, Victor Savkin [email protected]:
It looks like it is still not working. I can try to implement it.
— Reply to this email directly or view it on GitHubhttps://github.com/angular/angular.dart/issues/467#issuecomment-44100033 .
Reply to this email directly or view it on GitHub: https://github.com/angular/angular.dart/issues/467#issuecomment-44133578
Agree with @matsko and @vicb.
It is a valid point, however, that because all the browsers Dart supports are CORS enabled, the chances are you won't need JSONP. So maybe it should not be in the core angular library. In this case, we should just remove the jsonp
method from the Http service.
Yes good point. Also, is it possible to call a Dart callback function in the method that JSONP works with JavaScript?
@matsko it is possible (see https://www.dartlang.org/samples/jsonp/).
So what is the status on jsonp ?
IMO it could be a nice addition (some servers won't support cors). Any estimate of the effort this PR would be ?
I checked the AngularJS implementation of JSONP, and it is pretty straightforward. So I don't think implementing it for AngularDart will be challenging.
I can try to do it this week (if everyone is OK with adding JSONP support to AngularDart).
I'm all for adding it if the effort is not that big - @vsavkin no rush as I think it's low priority considering the previous comments.
@vicb I've implemented jsonp support, but I'm not 100% sure if it should be a part of AngularDart. The implementation does not depend on Angular in any way, and in theory can be use by other projects. On the other hand, it is less than 100LOC, so it may not be worth adding another dependency to the Angular project. Do you know what is the common practice? Should such things be extracted into separate projects or kept in Angular?
I would tend to prefer a separate package for the reasons you give. What do others think ?
(I think there is already a jsonp package on pub, what are the differences ?)
On June 1, 2014 6:55:56 PM CEST, Victor Savkin [email protected] wrote:
@vicb I've implemented jsonp support, but I'm not 100% sure if it should be a part of AngularDart. The implementation does not depend on Angular in any way, and in theory can be use by other projects. On the other hand, it is less than 100LOC, so it may not be worth adding another dependency to the Angular project. Do you know what is the common practice? Should such things be extracted into separate projects or kept in Angular?
Reply to this email directly or view it on GitHub: https://github.com/angular/angular.dart/issues/467#issuecomment-44782499
@vicb I looked at the JSONP package before doing the spike.
- It does quite a bit more than Angular needs.
- It depends on the
js
package. - The error handling appears to be broken.
- Judging by the last commit, which was about seven months ago, it has not been worked on lately.
- It uses the LGPL licence (not sure if it is a problem).
Doing more should not be a problem (Dart has tree shaking). The other items are more problematic.