AngularJS Bootstrap Popover按钮忽略<br/>

时间:2017-03-30 21:26:19

标签: angularjs angular-bootstrap

我们有一个Angular Bootstrap popover工具提示,其中包含一些html内容和范围变量以及popover内的按钮。

目前我们有small version running in Plunkr并且正确显示了popover html,包括所有中断标记。enter image description here

当我们在Visual Studio中本地运行时,在渲染按钮之前识别所有中断标记,然后它似乎被完全忽略并且按钮在弹出框的顶部被删除时,似乎会出现问题: / p>

enter image description here

<div>
    Name: {{ person.fullName }}
    <br />
    Dept: {{ person.deptId }}
    <br />
    Job Desc: {{ person.jobDesc}}
    <br />
    Phone:{{ person.phone}}
    <br />
    One!<br />
    Two!<br />
    Three!<br />
    <input type="button" value="Click Me" class="btn btn-default" ng-click="changeName()">

我们看到了几个帖子,其中使用了$ sce.trustAsHtml并添加了以及data-html ='true'

scope.htmlPopover = $sce.trustAsHtml('./HTML/popoverTemplate.html');
element[0].setAttribute('data-html', 'true');
element[0].setAttribute('uib-popover-template', "htmlPopover");
element[0].setAttribute('popover-append-to-body', 'true');
element[0].setAttribute('popover-trigger', "'click'");

这并没有解决我们的问题。

Plunk和我们的本地项目都运行Angular 1.6.2和Angular Bootstrap 2.5.0。

无法弄清楚为什么这会在Plunkr中运行而不在Visual Studio中。

我错过了什么吗?

感谢。

1 个答案:

答案 0 :(得分:0)

我们在cshtml页面中有一个css,其中存在导致冲突的现有.btn类。

由于我认为最后一个css条目获胜,我怀疑这是导致问题的。

删除该样式后,按钮显示正确。

enter image description here

感谢。