2016-12-02 1 views

답변

2

내가 말하고 싶지만 :

<div #width1> 
<div [style.width.px]="width2"> 

export class MyComponent 
{ 
width1: number; 
@ViewChild('width1') width1; 


ngAfterViewInit(){ 
    this.width2 = this.width1.nativeElement. width - 30; 

    } 
} 
+0

width1가 ngAfterViewInit()는 clientWidth와 함께 일 – Dynamic

+0

에 정의되어 있지 않습니다 :) – Dynamic

관련 문제