简体   繁体   English

错误:找不到指令“ slide”所需的控制器“轮播”

[英]Error: Controller 'carousel', required by directive 'slide', can't be found

Summary : 总结:

Whenever I try to use the data-slide in the HTML DOM , I get this error in my js console: 每当我尝试在HTML DOM使用data-slide时,都会在js控制台中收到此错误:

Error: [$compile:ctreq] Controller 'carousel', required by directive 'slide', can't be found! 错误:[$ compile:ctreq]指令'slide'所需的控制器'carousel'找不到!

I created a application with bootstrap and angularjs. 我用bootstrap和angularjs创建了一个应用程序。 I already added this library <script type="text/javascript" src="/bower_components/bootstrap/dist/js/bootstrap.js"></script> . 我已经添加了该库<script type="text/javascript" src="/bower_components/bootstrap/dist/js/bootstrap.js"></script>

I've included ui.bootstrap as a dependency when creating my app. 创建我的应用程序时,我已将ui.bootstrap包含为依赖项。

Entire error: 整个错误:

Error: [$compile:ctreq] Controller 'carousel', required by directive 'slide', can't be found!
http://errors.angularjs.org/1.4.10/$compile/ctreq?p0=carousel&p1=slide
    at angular.js:68
    at getControllers (angular.js:8432)
    at nodeLinkFn (angular.js:8570)
    at angular.js:8810
    at processQueue (angular.js:15097)
    at angular.js:15113
    at Scope.$eval (angular.js:16359)
    at Scope.$digest (angular.js:16175)
    at Scope.$apply (angular.js:16467)
    at done (angular.js:10852)

Relevant part of the template: 模板的相关部分:

<div id="carousel-example-generic" class="carousel" data-ride="carousel" data-interval="false">
                        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                            <span class="glyphicon glyphicon-triangle-left" aria-hidden="true"></span>
                            <span class="sr-only">Previous</span>
                        </a>
                        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                            <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
                            <span class="sr-only">Next</span>
                        </a>
</div>

When i removed data-slide="prev" & data-slide="next" this error not coming. 当我删除data-slide="prev"data-slide="next"此错误不会出现。

Any immediate help will be highly appreciable. 任何即时帮助将非常可贵。 Thanks. 谢谢。

我可以通过将ng-non-bindable到具有data-slide指令的元素来解决冲突:

  <a data-slide="prev" href="#clients-slider" ng-non-bindable class="left carousel-control">‹</a>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angularjs:错误:[$compile:ctreq] 指令“ngTransclude”所需的控制器“carousel”,无法找到 - Angularjs: Error: [$compile:ctreq] Controller 'carousel', required by directive 'ngTransclude', can't be found 角度与茉莉花错误:指令所需的控制器找不到 - Angular with Jasmine error: Controller required by directive can't be found 错误:[$ compile:ctreq]指令所需的控制器,找不到 - Error: [$compile:ctreq] Controller required by directive , can't be found AngularJS错误:指令“ drawing”所需的控制器“ drawing”找不到 - AngularJS Error: Controller 'drawing', required by directive 'drawing', can't be found 无法找到指令所需的控制器 - Controller Required By Directive Can't Be Found 无法找到指令&#39;...&#39;所需的控制器&#39;ngModel&#39; - Controller 'ngModel', required by directive '…', can't be found 找不到指令所需的AngularJS控制器 - AngularJS controller, required by directive, can't be found 无法找到指令'...'所需的控制器'ngModel' - Controller 'ngModel', required by directive '…', can't be found Angular JS缺少必需的控制器错误:找不到指令所需的控制器“ ngModel” - Angular JS Missing Required Controller error: Controller 'ngModel', required by directive can't be found 在ui-bootstrap中找不到指令&#39;accordionGroup&#39;所需的控制器&#39;accordion&#39;错误 - Controller 'accordion', required by directive 'accordionGroup', can't be found error in ui-bootstrap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM