我正在尝试使此代码正常工作。我希望结果是class =“project project.select”
ng-class="{'project': $state.current.name == 'project.select', $state.current.name}"
答案 0 :(得分:1)
一个解决方案是:
<elem ng-class="{'project': $state.current.name == 'project.select'}"
class="{{$state.current.name}}"></elem>