Multiple attributes in ng-style

TrtG picture TrtG · Apr 3, 2015 · Viewed 50.7k times · Source

I need to have multiple raw style attributes like :

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

<div ng-style="{css}">

This is not working. It works when I use

<div style="{{css}}">

But not for IE.

Answer

Pankaj Parkar picture Pankaj Parkar · Apr 3, 2015

Use below on view

<div ng-style="{
   'width': calc('100% -'+fixedColumnsWidth),
   'margin-left': fixedColumnsWidth}">