[英]Why do I get a nonassign error in the angular-bootstrap tabset?
<tabset class="paygrade-tabs">
<tab ng-repeat="tab in rps.currentPayGrade | orderBy: 'payGrade.code' : true track by $index" ng-click="changeTab(tab)" active="activeTabId === tab.id">
<tab-heading>
<span>{{tab.payGrade.code}}</span>
</tab-heading>
</tab>
</tabset>
This gives me an error for some reason: 由于某种原因,这给了我一个错误:
Error: [$compile:nonassign] http://errors.angularjs.org/1.4.14/$compile/nonassign?p0=activeTabId%20%3D%3D%3D%20tab.id&p1=active&p2=tab
at angular.js:38
at q (angular.js:9157)
at m (angular.js:9170)
at angular.js:14777
at n.$digest (angular.js:16219)
at n.$apply (angular.js:16492)
at g (angular.js:10872)
at A (angular.js:11070)
at XMLHttpRequest.w.onload (angular.js:11011)
What am I doing wrong? 我究竟做错了什么?
It's because you pass an expression to active
: 这是因为您将表达式传递给active
:
active="activeTabId === tab.id"
It needs something that it can bind to and write back to. 它需要可以绑定并写回的东西。
Pass a variable instead: 传递变量:
active="myVariable"
Where myVariable
is the index of the active tab. 其中myVariable
是活动选项卡的索引。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.