サービスを使用せずに、ionic 2の別の子コンポーネント(CustomPage)の子コンポーネント(HomePage)からメソッドを呼び出したい。2つの異なるタブに2つのコンポーネントを使用しています
You can use a template variable to get a reference to the sibling. If <app-controls> has an output where it emits events when a button is clicked you can do:
<app-controls (buttonClicked)="main.doSomething($event)"></app-controls>
<app-main #main></app-main>
or you can pass a reference to a @Input() siblings; and then call methods on it:
<app-controls [sibling]="main"></app-controls>
<app-main #main></app-main>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加