I'm trying to use bindonce
with an ng-repeat
and it is causing the error:
Controller 'bindonce', required by directive 'ngRepeat', can't be found!
Here is the div causing the issue:
<div bo-if="transcripts.userIsAuthorizedForCourseTranscripts" bindonce ng-repeat="module in transcripts.modules">
...
</div>
when you have an ng-repeat it actually creates the element from the clone. This means that for everything in the repeat, the new element has both the bo-if and the bindonce. It seems like you want to only do the repeat if you have authority.
So if you want to only do the repeat if
transcripts.userIsAuthorizedForCourseTranscripts === true
then you would nest it like this:I also made a fiddle showing this case http://jsfiddle.net/49c5C/1/
Hope this helped!