我需要通过引导提供的progressBar指令在属性中进行双向数据绑定。
在progressBar组件中,我们有以下内容
.constant('uibProgressConfig', {
animate: true,
max: 100
})当我在我的html中使用这个时,我就有了这个。
<uib-progress ng-repeat="bar in myCtrl.stacked track by $index" animate="myCtrl.isRunning" value="{{bar.value}}" type="{{bar.type}}"
style="width:{{myCtrl.percentage}}%; border-right: 1px solid #000; border-radius: 0px">我想要的是具有双向数据绑定的动画值属性。
animate="myCtrl.isRunning"问题是我不能用
animate={{myCtrl.isRunning}}因为我搞错了
错误:$parse:syntax语法错误语法错误:从{field}.$error开始的表达式{字段}.$error第2列中的令牌'{‘无效键。
是否存在将该属性“动画”绑定到模型的问题?
发布于 2016-08-10 15:53:21
看起来,在初始化指令控制器时,只读取一次动画属性。它既不是$watched也不是$observed
来自ui-bootstrap.js::UibProgressController
animate = angular.isDefined($attrs.animate) ? $scope.$parent.$eval($attrs.animate) : progressConfig.animate; 您可能需要将模块分叉并在$attrs.$observe('animate', setAnimate)中添加一个UibProgressController。
https://stackoverflow.com/questions/38875027
复制相似问题