0
角度新手在這裏運行Angular 1.3 & ui-bootstrap 0.12。我只是想學習Angular和ui-bootstrap,我不確定爲什麼Angular Bootstrap崩潰指令不會崩潰我的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);
而你的小提琴/ plunker/codepen是...? – 2015-02-08 17:27:42