UI Router conditional ui views?

后端 未结 9 1416
遥遥无期
遥遥无期 2021-01-30 21:23

I can\'t figure out a reasonable way, which doesn\'t feel like a hack, to solve this rather trivial problem.

I want a guest to see a splash page when they access the ind

9条回答
  •  不知归路
    2021-01-30 21:38

    If I understand the question; you want to make sure that the user who hasn't logged in cannot see a page that requires log in. Is that correct?

    I've done so with code like this inside a controller:

    if(!'some condition that determines if user has access to a page'){
     $location.path( "/login" );
    }
    

提交回复
热议问题