I know we can use a service, @Input and @Output so move data between components.
For example I can have this in a service:
@Injectable()
export class MyService {
myMethod$: Observable<any>;
private myMethodSubject = new Subject<any>();
constructor() {
this.myMethod$ = this.myMethodSubject.asObservable();
}
myMethod(data) {
this.myMethodSubject.next(data);
}
}
I am now building standalone components and need to (for example):
ComponentA -> lazy loads -> ModalComponent and now wants to send some data to it parameters or an object with data.
My question is...
For standalone / lazy loaded components in Angular 14, is this still a good way to do this of is there a better way?