将 AngularFire 与 Angular ui-router 一起使用时如何启用路由安全? [英] How to enable route security when using AngularFire with Angular ui-router?

查看:19
本文介绍了将 AngularFire 与 Angular ui-router 一起使用时如何启用路由安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用AngularFire routeSecurity 模块使用 angular UI-ROUTER 而不是标准的 ng-route 提供程序?是否有可以与 ui-router 一起使用的 routeSecurity 版本?

Is it possible to use theAngularFire routeSecurity module with angular UI-ROUTER instead of the standard ng-route provider? Is there a version of routeSecurity that would work with ui-router?

推荐答案

@mattvv 给了我这个 gist 当我在有角度的 irc 频道中谈论他时.所以基本上你只需要替换 angularfire 目录中的 routesecurity.js 文件,假设你使用 yeoman 来搭建你的应用程序.

@mattvv Gave me this gist while I was talking on him in the angular irc channel. So essentially you would just need to replace the routesecurity.js file in angularfire directory assuming that you used yeoman to scaffold your application.

一个简单的方法就是创建另一个名为 routesecurity-ui-router.js 的文件,而不是替换 routesecurity.js 的内容.

A neat thing to do is just to create another file named routesecurity-ui-router.js instead of replacing the content of the routesecurity.js.

所以为了提供一些关于要点的信息,基本上 mattvv 只是修改了 routes 术语并使用 state 代替.

So to give a little bit of information about the gist, basically mattvv just modified the routes term and use state instead.

这篇关于将 AngularFire 与 Angular ui-router 一起使用时如何启用路由安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆