[英]Error when iterating over array within array: “Cannot find a differ supporting object '[object Object]' of type 'object'.”
[英]“Cannot find a differ supporting object” when I am using ngstyle
我有進度條
<div class="progress-bar-line red" role="progressbar"
aria-valuenow="redrated" aria-valuemin="0" aria-valuemax="100"
ngStyle="max-width:{{redrated}}%"
>
<span class="title">{{ redrated }}%</span>
</div>
我已使用ngStyle="max-width:{{redrated}}%"
並嘗試嘗試:
ngStyle="{'max-width': '20px' }"
也出現相同的錯誤,請幫助我解決此問題 <!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <body> <div ng-app="myApp" ng-controller="myCtrl"> <div class="progress-bar-line red" role="progressbar" aria-valuenow="redrated" aria-valuemin="0" aria-valuemax="100" ng-style="{'max-width': '{{redrated}}%'}"> <span class="title">{{ redrated }}%</span> </div> </div> <script> var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.redrated = 20; }); </script> </body> </html>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.