Shr*_*awa 8 angularjs angular-ui-bootstrap
它的装载开口模态和指定的加载模板.但没有显示任何东西.
在这里查看演示:http://demo.hupp.in/food-admin
转到[Products]和Search EnegiKcal> = 3500.然后单击manage.它将打开弹出窗口但未加载模板内容.
另外我注意到的另一件事是它有时会返回模板的HTTP 304.
这是我打开模态的方式:
/** Open Modal For add edit tags */
$scope.open = function (productId) {
var modalInstance = $modal.open({
templateUrl: 'views/some.html',
controller: tagsModalInstanceCtrl,
size: 'lg'
});
modalInstance.result.then(function (msg) {
}, function () {
// $log.info('Modal dismissed at: ' + new Date());
});
};
var tagsModalInstanceCtrl = function ($scope, $modalInstance) {
$scope.ok = function () {
$modalInstance.close("hi");
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
};
Run Code Online (Sandbox Code Playgroud)
这是模板代码:
<div class="modal-header">
<h3 class="modal-title">I'm a modal!</h3>
</div>
<div class="modal-body">
<h3>Well, Hello there!</h3>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">OK</button>
<button class="btn btn-warning" ng-click="cancel()">Cancel</button>
</div>
Run Code Online (Sandbox Code Playgroud)


好的,这很奇怪,但似乎您的模板基于https://github.com/angular-ui/bootstrap/blob/master/template/modal/window.html的主分支
和您在标签0.11上的来源.
https://github.com/angular-ui/bootstrap/blob/0.11.0/src/modal/modal.js
当您在控制台中键入$('.modal-content')时,它是可见的,您将看到它需要一个modal-transclude指令,但在源中没有此指令的跟踪.因为,在0.11它直接使用ng-transclude指令,它是angular的一部分.
所以,你的代码是正确的,但lib不是,尝试检索它的正确版本(可能是他们的repo的最后一个版本被破坏)
| 归档时间: |
|
| 查看次数: |
14936 次 |
| 最近记录: |