Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
@ViewChild または @ViewChildren アノテーションを使用せずにサブコンポーネントにアクセスするにはどうすればよいですか? 例えば:
SubComponent getComponent() { return Whatever.getComponentBySelector('selector'); }
値へのアクセスが必要な場合は@output、子から値を取得するか、サービスを使用して子に関連データでサービスを更新させることができます。それがあなたの望むものなら。
@output