gpt4 book ai didi

angularjs - ui.bootstrap 模式加载 html 但不显示任何内容

转载 作者:行者123 更新时间:2023-12-03 06:52:03 24 4
gpt4 key购买 nike

其加载打开模式以及指定的加载模板。但没有显示任何内容。

在此处查看演示:http://demo.hupp.in/food-admin

前往 [产品] 并搜索 EnegiKcal >= 3500。然后单击管理。它将打开弹出窗口,但模板内容未加载。

我注意到的另一件事是它有时会为模板返回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');
};
};

这是模板代码:

<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>

enter image description here

enter image description here

最佳答案

好吧,这很奇怪,但看来你的模板是基于 https://github.com/angular-ui/bootstrap/blob/master/template/modal/window.html 的 master 分支

以及标签 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 的一部分。

因此,您的代码是正确的,但库不正确,请尝试检索它的正确版本(也许他们的存储库的最后一个版本已损坏)

关于angularjs - ui.bootstrap 模式加载 html 但不显示任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25952510/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com