angular.js - angular ui-router “deferIntercept” 是干什么的 应给如何应用
为情所困
为情所困 2017-05-15 17:04:31
0
1
564

“deferIntercept”

感觉这个东西对我有帮助,看文档不是很透彻。

有没有通俗一点的介绍,或demo 谢谢

为情所困
为情所困

reply all(1)
黄舟

The following is the normal writing method. . .

App.config(function ($stateProvider, $urlRouterProvider) {
    // $urlRouterProvider.deferIntercept();

    $urlRouterProvider.otherwise('/view/index');
    $stateProvider
            .state('Home', {
                url: '/view/index',
                templateUrl: 'view/index.html'
            })
            .state('Error', {
                url: '/view/error',
                templateUrl: 'view/error.html'
            })
});

If you add $urlRouterProvider.deferIntercept(), both the default route and the redirected route will be disabled. This is why the official website says to prevent URL jumps~

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template