コンパニオンセレクタの条件を追加することはできますか? exmpleについてはコンポーネントセレクタに条件を設定することができます角度2/4
私は2シンプル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>
これはいつも私に2番目のコンポーネントをロードしていますが、これを避けることはできますか?なぜそれが起こるのですか?その問題については何も見つかりません。
ありがとうございます。
plunker –