[Angular] ngIf structure directive 구조 디렉티브
사용예시 hello import { Component, OnInit, ViewChild } from '@angular/core'; @Component({ selector: 'app-test', templateUrl: './test.component.html', styleUrls: ['./test.component.css'] }) export class TestComponent implements OnInit { view = true; constructor() { } ngOnInit() { } } 이 경우 view 의 값이 true 이기 때문에 hello 가 출력된다. 여기서 *를 쓰는 ngIf 가 구조 디렉티브 이기 때문이다. 구조 디렉티브란 DOM 의 구조를 변형시키는 디렉티브란 뜻이다. 즉 true ..
Angular8
2020. 4. 7. 17:40