angular - Angular2 calling a function in a sibling component -
component a i have form button should call service class. service returns extracted json result. compare() { this.getresults(); } getresults() { this.resultservice.getresults() .subscribe( results => this.results = results, error => this.errormessage = <any>error); } template of a: <form (ngsubmit)="compare()" #compareform="ngform"> <div class="col-md-5"> <h1>disk forensics</h1> <div class="form-group"> <label for="resourcea">disk a</label> <select ngbdropdown class="form-control" id="resourcea" required [(ngmodel)]="resourcea" name="resourcea"> <option *ngfor="let r of disks" [value]="r.id">{{r.name}}</option> </select> </div> <div class="form-gr