gpt4 book ai didi

angularjs - jhipster 应用程序中的 has-any-authorithy 指令

转载 作者:行者123 更新时间:2023-12-01 04:34:58 25 4
gpt4 key购买 nike

我在我的 jhipster 应用程序中创建了一个新 Angular 色 ROLE_SUPERUSER。我希望特定的导航栏菜单仅对管理员和我的新用户可见。我尝试使用 authority.directive.js 中给出的 has-any-authorithy,但它不起作用。

我在 HTML 中使用它,例如

has-any-authorithy="['ROLE_ADMIN','ROLE_SUPERUSER']"

我错过了什么吗?

最佳答案

代码说:

authorities = attrs.hasAnyAuthority.replace(/\s+/g, '').split(',');

所以看起来指令需要一个字符串而不是一个数组。

试试这个:

has-any-authority="ROLE_ADMIN, ROLE_SUPERUSER"

关于angularjs - jhipster 应用程序中的 has-any-authorithy 指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36020206/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com