【发布时间】:2014-07-19 10:45:40
【问题描述】:
我有以下plunkr(代码如下)
我在角度模板之间切换。每个模板都有来自angular-ui 项目的progressbar 指令。
第一个模板具有属性'animate=false',而其余模板具有 animate=true。
我特意修改了模板,使它们彼此不同。 一个是空白的,其他的有包装的 div,等等......
然而,animate属性值的变化,却是被忽略的变化。所有指令都使用false。
我无法修改指令的实现。
- 如何使最后 2 个模板为进度更改设置动画
这是我生成的模板
angular.module("myProgressBarApp").run(["$templateCache", function($templateCache) {
$templateCache.put("first.html",
'<div>hello world</div><div><progressbar animate="false" value="progressPercentage" id="mograbi" class="progressbar"> <b>{{progressPercentage}}%</b></progressbar></div>');
$templateCache.put("second.html",
'<progressbar animate="true" id="guy" value="progressPercentage" type="primary" class="progressbar"> <b>{{progressPercentage}}%</b></progressbar>');
$templateCache.put("third.html",
'this is third');
$templateCache.put("fourth.html",
'<progressbar animate="true" id="guy3" value="progressPercentage" type="primary" class="progressbar"> <b>{{progressPercentage}}%</b></progressbar>');
$templateCache.put("fifth.html",
'<progressbar animate="true" id="guy4" value="progressPercentage" type="primary" class="progressbar"> <b>{{progressPercentage}}%</b></progressbar>');
}
]);
【问题讨论】:
标签: javascript angularjs angular-ui-bootstrap angular-directive