AngularJs location path change without all controllers resetting

后端 未结 2 1481
醉酒成梦
醉酒成梦 2021-02-06 06:23

Short version of my question is: How do I change the URL without need to trigger route change or without need to run all the controllers on the currently displayed page?

2条回答
  •  再見小時候
    2021-02-06 07:12

    Sounds like you don't want to use $route service.

    The $route service is designed to reload the controllers so that there is no difference between navigating to a URL and refreshing the URL. We do this by doing a full reload on every URL change. This is intentional.

    Sounds like your use case, should not be using $route, just $location and ng-include.

提交回复
热议问题