I try to pass data from child to parent by emitting but I don't have any child tag and go to the child just with the route, so how can listen to emit data?
parent.html
<ul class="list-unstyled multi-steps">
<li [ngClass]="{ ' is-active': status == 'first' }">
<span routerLink="/room/specification"></span>
step1
</li>
<li [ngClass]="{ ' is-active ': status == 'second' }">
<span routerLink="/room/attributes" (click)="onClick()"></span>
step2
</li>
</ul>
<div class="content">
<router-outlet></router-outlet>
</div>
specification-child.ts
@Output("specificationData") specificationData = new EventEmitter();
onSubmit() {
const data = { this.specificationForm.value };
this.specificationData.emit(data);
}
as you see there is no child tag that I can use
<child (specificationData)="getData($event)"></child>
so what sould i do?