rpocklin / ui-router-tabs

Idiot-proof tab panes with route support using Angular.js + Bootstrap 3 + UI Router
Other
244 stars 57 forks source link

How to prevent page refresh while tab changes ? #84

Closed fireworkstudio closed 8 years ago

fireworkstudio commented 8 years ago

How to prevent page refresh while tab changes ? Thanks.

pkishino commented 8 years ago

can you show a plunker that shows that behaviour please? I am not quite sure what you mean by refresh, if you mean full page refresh then that should not be happening. which versions are you using etc?

fireworkstudio commented 8 years ago

@pziegler

Take this example: I have two tabs: tabA and tabB, both contain some text input and datatable component. First fill some data in tabA and then press tabA's search button, tabA's datatable will present data sent from server. Then switch to tabB and return to tabA. The data in text input and datatable disappeared as the tabA's controller reinitialized.

I tried some methods , such as $state.transitionTo(tab.route, tab.params, { reload: false, inherit: false, notify: true });

but still not resolved. BTW, I am using AngularJS 1.3.9, UI-Router 0.2.18

Thanks

pkishino commented 8 years ago

should merge this question with #82 it's about keeping the content and stateful transitions as well. would be better to keep discussion in one thread. found this in ui-router https://github.com/angular-ui/ui-router/issues/2096 I would look on stackexchange or the ui-router project as this isnt really related to the tabs project itself

fireworkstudio commented 8 years ago

@pziegler

I think it's issue of ui-router project, should I close current issue ?

pkishino commented 8 years ago

yes, I think that would be preferable . You can always link to this issue when you create a new issue there (or if you search you might find..) I think you want something like sticky states or so

fireworkstudio commented 8 years ago

@pziegler Thanks, I am closing this issue

softzer0 commented 8 years ago

Seems like that behavior has been fixed in the latest update of ui-router for Angular 1, but if I'm not wrong that is still not yet released - current revision is still in development state (the latest version is still 0.3.1)...

fireworkstudio commented 8 years ago

@MikiSoft That's cool, looking forward to it

softzer0 commented 7 years ago

I forgot to ask, have you tried it on v0.3.1 to see if it works with it?

fireworkstudio commented 7 years ago

@MikiSoft I used another open source solution which depends on tabs. sx-tabs

Here is my demo project (not completed yet) firework-admin

and this is one screenshot image