0
compnente 선택기에 조건을 추가 할 수 있습니까? 부여 됨으로써구성 요소 선택기에 조건을 설정할 수 있습니까? 각도 2/4
나는이 간단한 compnenets있는 경우 :
@Component({
selector:'app-first'
templateHtml: 'first.html;
})
export class FirstComponent {
check=false;
}
둘째 :
먼저
@Component({
selector:'app-second'
templateHtml: 'second.html;
})
을 내 first.html 파일에 내가 설정 이 조건 :
<div *ngIf="check">
<app-second></app-second>
</div>
항상 두 번째 구성 요소에 어떤 식 으로든로드됩니다.이를 피할 수 있습니까? 그리고 그 이유는 무엇입니까?
감사합니다.
plunker –