gpt4 book ai didi

angularjs - Angular UI 中的弹出框模板

转载 作者:行者123 更新时间:2023-12-04 06:38:13 32 4
gpt4 key购买 nike

我在当前项目中使用 angular-ui-bootstrap,并且我需要在显示行特定信息的网格中的每一行中打开一个弹出框。弹出框应该有自己的 HTML 模板,并且可以在 HTML 模板中绑定(bind)多个字段。这是我为实现相同目标而编写的代码。我确实尝试过没有运气的 html 模板。任何帮助表示赞赏。

HTML 代码:

<div ng-app="helloAngular" ng-controller="casesCntrl">
<table class="table table-bordered">
<thead>
<tr>
<th class="">Date</th>
<th class="">Case</th>
<th class="">Severity</th>
<th class="">Status</th>
<th class="">Site</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="case in cases">
<td>{{case.casedate | date:'MM/dd/yyyy'}}</td>
<td><a ng-href="#/site/{{case.id}}">{{case.name}}</a></td>
<td ng-class="{'case-critical':case.severity==1, 'case-urgent':case.severity==2, 'case-normal':case.severity==3}" class="case-none"></td>
<td>{{case.status}}</td>
<td>{{case.sitename}}&nbsp;<button popover="{{case.sitename}}" popover-title="{{case.sitedescription}}" data-placement="bottom" data-trigger="focus" class="btn btn-default" popover-unsafe-html="This is a Help but please <b> focus </b> on this">V</button></td>
</tr>
</tbody>
</table>
</div>

JS代码:
function CasesController($scope) {    

var casesData = [
{

"name": "Case -1",
"casedate":"2013-06-26T08:02:00-0700",
"caseid":1,
"severity": "1",
"status":"New",
"siteid":1,
"sitename":"Merchant Demo 1"
},
{
"name": "Case -2",
"casedate":"2013-01-26T08:02:00-0700",
"caseid":2,
"severity": "1",
"status":"New",
"siteid":2,
"sitename":"Merchant Demo 2"
},
{
"name": "Case -3",
"casedate":"2013-02-26T08:02:00-0700",
"caseid":3,
"severity": "1",
"status":"Accepted",
"siteid":1,
"sitename":"Merchant Demo 3"
} ,
{
"name": "Case -4",
"casedate":"2013-05-26T08:02:00-0700",
"caseid":4,
"severity": "2",
"status":"New",
"siteid":1,
"sitename":"Merchant Demo 4"
} ,
{
"name": "Case -5",
"casedate":"2013-09-26T08:02:00-0700",
"caseid":5,
"severity": "3",
"status":"New",
"siteid":1,
"sitename":"Merchant Demo 5"
} ,
{
"name": "Case -6",
"casedate":"2013-04-26T08:02:00-0700",
"caseid":6,
"severity": "1",
"status":"Sent to billing",
"siteid":1,
"sitename":"Merchant Demo 6"
},
{
"name": "Case -7",
"casedate":"2013-10-26T08:02:00-0700",
"caseid":7,
"severity": "3",
"status":"New",
"siteid":1,
"sitename":"Merchant Demo 7"
}
];
$scope.cases = casesData;
}

这是具有与上述相同代码的 fiddle :
http://jsfiddle.net/anirbankundu/YyK5s/4/

我确实按照 https://github.com/angular-ui/bootstrap/pull/641 中的描述通过 popover-unsafe-html 尝试了该选项。

最佳答案

现在无法完成,请查看以下问题以获取更多详细信息:
https://github.com/angular-ui/bootstrap/issues/220

您可以使用 angular-strap 来实现这一目标。详情请访问:http://mgcrea.github.io/angular-strap/##popovers

关于angularjs - Angular UI 中的弹出框模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21982204/

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