반응형
ng-style의 다중 속성
다음과 같은 raw style 속성을 여러 개 가질 필요가 있습니다.
$scope.css = "'width': 'calc(100% - "+$scope.fixedColumnsWidth+"'),'margin-left':'"+ $scope.fixedColumnsWidth+"'";
<div ng-style="{css}">
이거 안 되네.사용할 때 동작합니다.
<div style="{{css}}">
IE에는 해당되지 않습니다.
아래 보기 사용
<div ng-style="{
'width': calc('100% -'+fixedColumnsWidth),
'margin-left': fixedColumnsWidth}">
ng-style은 오브젝트 리터럴을 대기하기 때문에 코드를 다음과 같이 조정해야 합니다.
$scope.css = {
width: 'calc(100% -'+$scope.fixedColumnsWidth+')',
'margin-left': $scope.fixedColumnsWidth
}
<div ng-style="css"></div>
언급URL : https://stackoverflow.com/questions/29435883/multiple-attributes-in-ng-style
반응형
'sourcecode' 카테고리의 다른 글
프로파일링 조언 - 사이트 로딩 문제를 특정하려고 합니다. (0) | 2023.03.05 |
---|---|
iframe에서 상위 창의 요소에 액세스합니다. (0) | 2023.03.05 |
Wordpress - 메타 필드 내용을 기반으로 게시물을 가져옵니다. (0) | 2023.03.05 |
스프링 부트 버전 관리 규약이란 무엇입니까? (0) | 2023.03.05 |
Oracle 사용자와 스키마의 차이점 (0) | 2023.03.05 |