Suppress reloading of ui-router based view on query parameter change

前端 未结 3 739
无人共我
无人共我 2020-12-14 10:04

Updated question

Question in title still stands - is it possible to catch ?parameters and cancel view reload.

Original

3条回答
  •  情书的邮戳
    2020-12-14 10:12

    This can be achieved by using nested states. the code will look something like this

     $stateProvider.state('viewtopic', {abstract:true,
    url:/topics,
    resolve: {
                topic: function ($stateParams, Topic) {
                    // Wrapper around Restangular. Returns promise.
                    return new Topic().get($stateParams.slug);
                }
            },
    views: {
    templateUrl: