I met following error in the console when using angular-bootstrap ui. I have angular 1.2.6, bootstrap 3.0, and angular-bootstrap 0.10.0.
Error: [$compile:ctreq] Controller 'accordion', required by directive 'accordionGroup', can't be found!
Anyone know why it happens? My html code.
<div ui-view>
<accordion-group id="crud-talbe" ng-repeat="grid in grids" heading="{{grid.name}}">
<a ng-click="createNewEntity(grid.name)" class="btn btn-default">create new {{grid.name}}</a>
<div class="crudGridStyle" ng-grid="grid" />
</accordion-group>
From the code you have provided, you aren't including enough of the required code from ui-bootstrap.
This looks like the minimum of what you need and why the compiler is giving the error.
This is straight off the ui-bootstrap site... accordion section.
You can see that in the accordion group directive's code that the accordion is required...
From github:
In my case I was using UI-router to redirect to a $state from the controller I defined in the config.router.js of my app. I guess this was triggering before the controller had a chance to acknowledge the directive.
I just wrapped that redirect in a $timeout:
Ran into a similar issue using an up-to-date ui-bootstrap (as of 2/29/16). In my markup, I did have both the uib-accordion and uib-accordion-group directives as required. I initialized isOpen, isDisabled just to see if that was the problem and still saw the issue.
It only manifested itself on mobile Safari for me BTW. The error message was VERRRRY similar and only appeared the very first time the app loaded on that device. It didn't actually hinder the app in any way, just annoying.
Adding the technically optional, but preferred "data-" before all angular directives seemed to fix the issue.
i found this error when $compile by myself. cause my code html
change to
i fixed it