javascript - Open new window (tab) and keep data -
this problem similar angular uirouter open state in new window or tab stateparams, answer not seem work.
i'm displaying grid users can select 1000 rows. there's print button supposed open new tab in browser these rows in printable format.
in controller, i'm setting these rows (articles) in service, open new window:
articlesservice.setarticles(selected); $window.open($state.href('newwindow', {}, {absolute: true}), '_blank'); this open new tab, however, data in service lost. i'm supposed use new tab. thinking storing data in cookie, have more 1000 rows, that's not option. i'm not passing in url, user can select whatever wants.
is there way achieve functionality?
you need store data using ngstorage:
http://ngmodules.org/modules/ngstorage
this module enables store data in browser , use different tabs , across sessions; provides access browser's local storage in proper angular fashion. local storage persistent (key, value) tuple storage mechanism.
Comments
Post a Comment