property 바인딩 : []

요소 : [src]

컴포넌트 속성: [m_field]

디렉티브 속성 : [ngClass], [ngStyle]

컴포넌트 => DOM

속성의 값을 DOM 의 영역에 출력

컴포넌트의 값을 DOM 에 출력


<img [src] = 'maxim.imageUrl'>

<img [src] = {{maxim?.imageUrl}}>

<img [style.width.px] = 'imageSize' />

<img src = {{maxim.imageUrl}}>



#이름지정

특정 폼 컨트롤에  #별칭 형태로 ID 속성을 지정가능

<input #txtName />

txtName.value 로 값 접근 가능

ex) <select #select (change)="selection(select.value)">

<option>RED</option>

<option>GREEN</option>

</select>

selection(select.value) => selection($event.target.value)


'angular' 카테고리의 다른 글

visual studio code angular intellisense  (0) 2017.06.25
Json 바인딩  (0) 2017.03.01
ngModel 과 양방향 바인딩  (0) 2017.02.25
데이타 입출력  (0) 2017.02.25
angular cli  (0) 2017.02.25

+ Recent posts