mercredi 25 février 2015

Chrome 'duplicate tab' and back button for angular/ember apps

Chrome's duplicate tab feature doesn't copy the data in text fields for tabs which have open a javascript single page app (SPA) written on a framework like angluar.js or ember.js. How can I make my javascript app compatible with Chrome's duplicate tab feature?


Demonstration: The TodoMVC app is an SPA implemented in many js frameworks for comparison of the frameworks.


For the jQuery (non-framework example) and backbone apps, duplicate tab works. Type something in the textbox (DO NOT hit the enter key) then right click the tab and click 'Duplicate' in Chrome. The text you typed will appear in the duplicated tab. http://ift.tt/1AMC1Gt http://ift.tt/1FY93rC


However, for these examples, duplicating the tab does not duplicate the text in the "What needs to be done?" textbox. http://ift.tt/1uFMIta http://ift.tt/1FY93rD




Back button - related concern: in the above apps, if you try typing in some text (without hitting the enter key) and then, navigate away from the page, and hit the back button in your browser, the text you typed in the form is lost for angular/ember apps. How does one easily make their app persist form fields while navigating?





Aucun commentaire:

Enregistrer un commentaire