search

Home  >  Q&A  >  body text

angular.js - For a single page written in ng, every time you return to the previous page, the data must be reloaded, that is, the (loading) waiting process. How to solve this problem?

1. The dynamic data of each page is obtained in the controller using $http.get(), and then looped out using ng-repeat on the html page!
2. Jump to the page and return to the previous page. I write it with a tag.
Problem: Every time you return to the previous page, you have to reload the data, which gives the user a terrible experience!

PHP中文网PHP中文网2805 days ago645

reply all(1)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-15 17:11:08

    What do you use for routing? ui-router? Don’t jump directly to the a tag on a single page. You have to reload the resources every time.

    Generally, single-page routing has corresponding jump methods.

    Ng1, ui-router

    1. router-link='/xxx/xxx'

    2. In controller, $state.go('/xxx/xxx');

    reply
    0
  • Cancelreply