我是新角js 我必须打开一个模式对话框,显示一些选定的值。角模态 - 从一开始就显示模态,我不能隐藏它
打开模态
<div modal="showModal" close="cancel()">
<div class="modal-header">
<h4>Modal Dialog</h4>
</div>
<div class="modal-body">
<p>E{{inputValue}}</p>
</div>
<div class="modal-footer">
<button class="btn btn-success" ng-click="ok()">Okay</button>
<button class="btn" ng-click="cancel()">Cancel</button>
</div>
</div>
对于包含模态的模块的控制器是:
var app = angular.module('myApp', ['ui.bootstrap.modal']);
app.controller('ctrlTags', function($scope){
$scope.inputValue=$('input:checked').val()
$scope.open = function() {
$scope.showModal = true;
return $scope.inputValue;
};
$scope.ok = function() {
$scope.showModal = false;
};
$scope.cancel = function() {
$scope.showModal = false;
};
});
出于某种原因,如它是在网页的常规部分被显示的模态(没有按不起作用模式)
首先,您应该更正依赖模块的名称。使用'ui.bootstrap'而不是'ui.bootstrap.modal'。 –
@Hamlet Hakobyan-它没有帮助 –