で使用しようとしてbindonce
いng-repeat
ますが、エラーが発生しています:
ディレクティブ「ngRepeat」で必要なコントローラー「bindonce」が見つかりません!
問題の原因となっている div は次のとおりです。
<div bo-if="transcripts.userIsAuthorizedForCourseTranscripts" bindonce ng-repeat="module in transcripts.modules">
...
</div>
ng-repeat がある場合、実際にはクローンから要素が作成されます。これは、repeat 内のすべてについて、新しい要素に bo-if と bindonce の両方があることを意味します。権限がある場合にのみ繰り返しを実行したいようです。
したがって、if のみを繰り返したい場合は、次のtranscripts.userIsAuthorizedForCourseTranscripts === true
ようにネストします。
// This assumes bindonce is declared above
<div bo-if="transcripts.userIsAuthorizedForCourseTranscripts">
<div bindonce ng-repeat="i in stuff">
#This area has bindonce using i
</div>
</div>
このケースを示すフィドルも作成しましたhttp://jsfiddle.net/49c5C/1/
これが役に立ったことを願っています!