ui.bootstrap deforms the <progress> HTML tag

谁说胖子不能爱 提交于 2019-12-22 04:46:34

问题


In my HTML file I have a <progress> tag and I also injected the ui.bootstrap dependency to my controller as follows:

var myApp = angular.module("myApp",["ui.bootstrap"]);

In this configuration, AngularJS converts the <progress></progress> into:

<div class="progress ng-isolate-scope" ng-transclude=""></div>

When I remove "ui.bootstrap" it works fine. You can play out with this sample JSFiddle.

When progress turned into <div class="progress ng-isolate-scope" ng-transclude=""></div> it disappears. I understand that there is a directive called progress in ui.bootstrap that makes this conversion.

So, how can I make this progress bar work? Or, how can I disable the progress directive of angular-ui without removing the dependency?

Thanks in advance.


回答1:


I just ran into this same issue. A simple workaround is to use ng-non-bindable which is a standard angualr directive. The drawback is you can't use any angular directives or bindings within the progress element.

<progress ng-non-bindable></progress>



回答2:


I am not sure if I understand your question or which version of uiBootstrap you are using.

The directive should be:

<div ng-controller="MainCtrl">
        <progressbar value="55"></progressbar>
</div>

I changed the version of uiBootstrap and included the necessary bootstrap.min.css in this forked Fiddle and everything seems to work fine. (look at external resources)



来源:https://stackoverflow.com/questions/24882382/ui-bootstrap-deforms-the-progress-html-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!