Multiple attributes in ng-style

前端 未结 2 994
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-17 07:15

I need to have multiple raw style attributes like :

$scope.css = \"\'width\': \'calc(100% - \"+$scope.fixedColumnsWidth+\"\'),\'margin-left\':\'\"+ $scope.fi         


        
2条回答
  •  囚心锁ツ
    2021-01-17 07:50

    ng-style waits for an object literal, so you need to adjust your code to

    $scope.css = {
     width: 'calc(100% -'+$scope.fixedColumnsWidth+')',
     'margin-left': $scope.fixedColumnsWidth
    }
    
    

提交回复
热议问题