我使用对话框服务创建了一个弹出窗口。
我计划向用户显示一些这样的消息
txt = '<ul>
<li data-ng-repeat = "eachValue in dummnyList" >
{{eachValue | applyFilter}}
</li></ul>' ;
它正在成功处理,但它考虑了 {{eachValue | applyFilter}} 作为文本。
- {{每个值 |应用过滤器}}
我错过了什么吗?
弹出的完整代码是
var txt = '<ul>
<li data-ng-repeat = "eachValue in dummnyList" >
{{eachValue | applyFilter}}
</li></ul>' ;
var proceedButton = {label:'Ok', result: 'ok', cssClass: 'btn blue-button', returnFunction: proceedFunction};
var cancelButton = {label:'Cancel', result: 'not ok', cssClass: 'btn red-button', returnFunction:cancelFunction};
var buttons = [];
buttons.push(proceedButton);
buttons.push(cancelButton);
DialogUtils.openMessageBox({
title: 'Note',
message: txt,
buttons: buttons
});
最佳答案
这就是你的问题。 AngularJS 不知道您添加了这段代码。您可以使用 $compile 添加代码,如this question .
$('body').append($compile("<my-angular-directive />")(scope));
scope.$apply();
但是你应该考虑摆脱旧的 jQuery 并用 Angular 完全解决你的问题......
关于javascript - Ng 重复不在 li 内工作弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24549994/