Angular新手在这里运行Angular 1.3& ui-bootstrap 0.12。我只是想学习Angular和ui-bootstrap,并且不确定为什么Angular Bootstrap collapse指令不会折叠我的div。正确点击按钮切换$ scope.rightPanelCollapse,但崩溃没有发生。
这是我的标记:
<body ng-app="uxf.site">
<div class="container-fluid" data-ng-controller="UxfSiteController">
<button data-ng-click="toggleRightPanelCollapse()">{{rightPanelCollapse}}</button>
<button data-ng-click="toggleRightPanelCollapse()">{{rightPanelCollapse}}</button>
<div class="row">
<div id="left-panel" class="col-md-1 grid">
{{rightPanelCollapse}}
</div>
<div id="content" class="col-md-10 col grid">
{{rightPanelCollapse}}
</div>
<div id="right-panel" collapse="rightPanelCollapse">
{{rightPanelCollapse}}
</div>
</div>
</div>
这是我的JS:
(function(angular) {
'use strict';
angular.module('uxf.site', [])
.controller('UxfSiteController', ['$scope', function($scope) {
$scope.rightPanelCollapse = true;
$scope.toggleRightPanelCollapse = function() {
$scope.rightPanelCollapse = !$scope.rightPanelCollapse;
};
}]);
})(window.angular);
答案 0 :(得分:0)
...新手搬家。我忘了在我的uxf.site模块中添加ui.bootstrap.collapse作为依赖项。问题解决了。