You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to introduce turbo in certain parts of my AngularJS application. Even though Turbo.session.drive = false; has been set a global level, and only few elements have data-turbo=true, I'm finding that turbojs intercepts the browser's back button, and ends-up making an additional HTTP GET request to the URL (over and above whatever Angular is doing), and ends-up rendering a blank page, thus completely breaking the client-side app.
How do I get to the bottom of what is happening and fix it?
Turbo is being loaded along with angular in this manner:
Turbo.session.drive=false;Turbo.cache.exemptPageFromCache();Turbo.cache.exemptPageFromPreview();document.addEventListener('DOMContentLoaded',function(){try{constpb=angular.element('[ng-app]').injector().get('progressbar');document.addEventListener('turbo:before-fetch-request',function(evt){if(evt.detail.fetchOptions.headers['X-Sec-Purpose']!='prefetch'){pb.start();// start the on-page angularJs progress bar even if turbojs makes the network request}});document.addEventListener('turbo:before-fetch-response',function(){pb.complete();// stop the on-page angularjs progress bar});document.addEventListener('turbo:before-fetch-response',asyncfunction(evt){constresp=evt.detail.fetchResponse.response;if(resp.status>=500&&resp.status<600){// common client-side code to handle 5xx erorrs}elseif(resp.headers.get('x-sec-purpose')!='prefetch'&&resp.status==400&&resp.headers.get('content-type').includes('application/json')){// common client side code to display validation errors}});}catch(e){console.log('error in setting up integration with angular progress bar',e);}document.addEventListener('turbo:frame-load',function(event){// re-initialize bootstrap tooltips inside turbo framssconsole.log('turbo:frame-load',$(event.target).find('[data-toggle="tooltip"]'));$(event.target).find('[data-toggle=tooltip]').tooltip();});});
The text was updated successfully, but these errors were encountered:
I'm trying to introduce
turbo
in certain parts of my AngularJS application. Even thoughTurbo.session.drive = false;
has been set a global level, and only few elements havedata-turbo=true
, I'm finding that turbojs intercepts the browser's back button, and ends-up making an additional HTTP GET request to the URL (over and above whatever Angular is doing), and ends-up rendering a blank page, thus completely breaking the client-side app.How do I get to the bottom of what is happening and fix it?
Turbo is being loaded along with angular in this manner:
Further, here's what
turbojs_config
contains:The text was updated successfully, but these errors were encountered: