sw-toolbox angular 2 jsonp -


is possible use sw-toolbox dynamic urls generated angular 2 jsonp? urls like

  • base_url?callback=__ng_jsonp__.__req0.finished&other_params
  • base_url?callback=__ng_jsonp__.__req1.finished&other_params
  • base_url?callback=__ng_jsonp__.__req2.finished&other_params

and responses like

  • /**/__ng_jsonp__.__req0.finished({some_content})
  • /**/__ng_jsonp__.__req1.finished({some_content})
  • /**/__ng_jsonp__.__req2.finished({some_content})

if other jsonp piece same, want cache see them same , modify response have correct jsonp name per request. feasible? seems should. messing trying change request base_url?callback=hardcoded&other_params. part seemed work, not figure out how modify response have correct jsonp in place of hardcoded piece. advice? here's snippet.

self.toolbox.router.get(/.*site\.com.*/, function(request, values, options) {     var url = request.url.replace('__ng_jsonp__.__req0.finished', 'hardcoded');     var newrequest = new request(url, request);     return self.toolbox.cachefirst(newrequest, values, options); });   


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -