0
我想根据某些路径在我的AngularJS应用中隐藏一个头元素。到目前为止,我有这样的:
<header logo="appModel.config.logoUrl" ng-hide="currentPath==='/brandHealth/metricsWidget'"></header>
这工作得很好,但是当我改变currentPath
到'/brandHealth/*'
这是行不通的。我需要它为brandHealth
子集中的所有网址工作。任何方式来做到这一点?
谢谢进阶
我有'currentPath'的方式vailable通过我的控制器是这样的:'$ scope.currentPath = $ location.path();' – amigo21
你使用什么路由器?如果您使用的是UI路由器,则可以使用它轻松完成。 – apaul
@apaul使用ngroute – amigo21