AngularJS ui-router login authentication

前端 未结 10 2433
[愿得一人]
[愿得一人] 2020-11-22 11:13

I am new to AngularJS, and I am a little confused of how I can use angular-\"ui-router\" in the following scenario:

I am building a web application which consists of

10条回答
  •  野性不改
    2020-11-22 11:15

    I Created this module to help make this process piece of cake

    You can do things like:

    $routeProvider
      .state('secret',
        {
          ...
          permissions: {
            only: ['admin', 'god']
          }
        });
    

    Or also

    $routeProvider
      .state('userpanel',
        {
          ...
          permissions: {
            except: ['not-logged-in']
          }
        });
    

    It's brand new but worth checking out!

    https://github.com/Narzerus/angular-permission

提交回复
热议问题