I have a component where I select a set of image objects. I want to pass these selected images to my new route, CreateAlbum. The data it nested and wouldn't be suitable to pass as URL parameters.
Is there any easy way to achieve this?
Here's my code to navigate to the route
public gotoCreateAlbum(): void {
this.router.navigate([('/create-album')])
}
My selected data sits in this variable
@Input() selectedPhotos: IPhoto[];
and this is my routing module
const routes: Routes = [
{ path: 'photos', component: PhotosComponent},
{ path: 'photos/:filter', component: PhotosComponent},
{ path: 'create-album', component: CreateAlbumComponent}
];
Basically I want to perform the same operations as if the CreateAlbum component was a child to my current component in which case I would have used @Input()