To implement the Yelp API a signature is needed. Therefor, this signature should be generated while passing all the parameters for the URL which gonna be use.
Long story short, since I query the API within the help of jsonp, the tricks was to generate first the next JSONP callback ID, to include it in the signature generation (reference: how to custom set angularjs jsonp callback name?)
In Angular 1 something like:
// Prepare parameters
var callbackId = (<any> angular).callbacks.counter.toString(36);
// Update my params with: callback='angular.callbacks._' + callbackId
// Query my backend to generate a signature
// Query Yelp API
Now that I'm migrating to angular2, I've to migrate that voodoo magic too. Anyone have got an idea how could I query the next jsonp callback ID which gonna be use respectively how to replace
(<any> angular).callbacks.counter
in angular2?
I saw that BrowserJsonp contains a nextRequestID() but I didn't found a way to access it (it's a private factory if I'm not wrong).
P.S.: For the record, I found that
angular.callbacks._ID
should be replaced in my angular2 with
__ng_jsonp__.__reqID.finished