【发布时间】:2015-02-15 17:14:33
【问题描述】:
在我的 Angular 项目中,我使用了一个特定的值,在我的控制器中被称为:
$scope.feature1.items.thisItem
在我看来,有一个特定的<div> 多次使用thisItem,例如将其称为{{feature1.items.thisItem}} 非常混乱:
<div id="{{feature1.items.thisItem}}header>
<h1> You've reached the section about {{feature1.items.thisItem}} </h1>
</div>
有没有办法在视图中重命名这个变量?我想简单地称它为one。我试过{{feature1.items.thisItem as one}},但没用。还有其他想法吗?
【问题讨论】: