0

I have an AngularJS 1.6 app. There is one particular route to a view that displays a calendar to the user.

When the user clicks on entries in the calendar, they are routed to a view with information about that entry. Before the user is routed away from the calendar view, the state of the calendar is saved in an AngularJS service so that when the user eventually returns to the calendar view, the state can be retrieved from the AngularJS service and used to initialize the calendar to a similar state.

The above is a working solution.

However, I would like to know if AngularJS has functionality so that when the user is routed to another view from the calendar, the calendar view can somehow stay resident in memory so that when the user returns to the calendar view, the user can be presented with the same calendar view instead of having to initialize a new instance of the calendar view.

4
  • 2
    The ngRoute router only supports one ng-view at a time. The UI-Router supports more than one view on a page. One could have a calender view and a details view on the same page. Commented Aug 8, 2018 at 17:56
  • That seems like an unfortunate limitation. I know I'm using the "legacy" version of AngularJS, but this seems like a feature that would have innumerable use-cases. Commented Aug 8, 2018 at 18:03
  • When you say "legacy" AngularJS, do you mean AngularJS V1.2? The UI-Router works with AngularJS V1.7. It is relatively easy to migrate to from the ngRouter router. In fact most templates and controllers will work without any changes. Commented Aug 8, 2018 at 18:29
  • I meant Angular 1.X as opposed to Angular 4. Commented Aug 8, 2018 at 21:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.