Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs Angular JS-ui.bootstrap.collapse无法正常工作_Angularjs_Angular Ui Bootstrap - Fatal编程技术网

Angularjs Angular JS-ui.bootstrap.collapse无法正常工作

Angularjs Angular JS-ui.bootstrap.collapse无法正常工作,angularjs,angular-ui-bootstrap,Angularjs,Angular Ui Bootstrap,我正在为我的应用程序使用Angular ui引导。我试图使用angular ui引导的折叠属性 我正在做与折叠部分中的示例相同的操作。但我不明白我在代码中所做的是什么,这是不能正常工作的 这是我的代码片段 <h1>Your Connections</h1><a href="" ng-click="isCollapsed = !isCollapsed" class="button-link">Invite your friend to join you</

我正在为我的应用程序使用Angular ui引导。我试图使用angular ui引导的折叠属性

我正在做与折叠部分中的示例相同的操作。但我不明白我在代码中所做的是什么,这是不能正常工作的

这是我的代码片段

<h1>Your Connections</h1><a href="" ng-click="isCollapsed = !isCollapsed" class="button-link">Invite your friend to join you</a>
            <div collapse="isCollapsed">
                <button style="float:right; margin-right: 4px; margin-top: 5px; background-color: #8AA8BD; height: 30px" ng-click="sendInvite()">Send</button>
                <input type="text" class="well well-sm" style="float: right">
            </div>
以及下面的错误

TypeError: Cannot read property 'then' of undefined
at e (ui-bootstrap-tpls-0.13.0.min.js:8)
at Object.fn (ui-bootstrap-tpls-0.13.0.min.js:8)
at Object.$get.Scope.$digest (angular.js:9831)
at Object.$get.Scope.$apply (angular.js:10039)
at angular.js:1127
at Object.invoke (angular.js:3123)
at doBootstrap (angular.js:1125)
at bootstrap (angular.js:1140)
at angularInit (angular.js:1091)
at angular.js:17898(anonymous function) @ angular.js:7818$get @ angular.js:5601$get.Scope.$digest @ angular.js:9843$get.Scope.$apply @ angular.js:10039(anonymous function) @ angular.js:1127invoke @ angular.js:3123doBootstrap @ angular.js:1125bootstrap @ angular.js:1140angularInit @ angular.js:1091(anonymous function) @ angular.js:17898trigger @ angular.js:1990(anonymous function) @ angular.js:2246forEach @ angular.js:196eventHandler @ angular.js:2245
TypeError: fn is not a function
at angular.js:11316
at completeOutstandingRequest (angular.js:3457)
at angular.js:3751
请帮我找出代码中的错误。
任何帮助都将不胜感激。。。。谢谢。

我找到了问题的答案。 问题是我使用的是Angular JS的旧版本(1.2.X版)。 UI引导程序不支持此版本。一旦我用Angular JS的最新版本(1.4.3版)更新了我的项目,代码就开始为我工作了


注意:-至少需要1.3.X版才能使Angular UI引导程序适用于您的代码

问题可能不在显示的代码段范围内。您是否在html中正确设置了模块和控制器,并设置了ng应用程序和ng控制器?您是否在其他任何地方使用isCollapsed变量,并在控制器中初始化它?它在这个垃圾桶里工作,谢谢你的回复@Sapy。我所做的和在plunker中给出的完全相同。此外,我已经在我的html中正确设置了我的ng应用程序和ng控制器。但我不知道代码中有什么错误。使用链接href=”“可能会导致每次单击页面时重新加载页面。尝试使用按钮
单击此处
项目中是否还有其他一些代码?该错误可能在其他地方生成。